Skip to content

Instantly share code, notes, and snippets.

@mushfiqweb
Created April 24, 2017 14:27
Show Gist options
  • Save mushfiqweb/3c194febf277f31c2f39bf3966f5da7e to your computer and use it in GitHub Desktop.
Save mushfiqweb/3c194febf277f31c2f39bf3966f5da7e to your computer and use it in GitHub Desktop.
// state variable is immutable
var state = freezer.get();
// Accessing is easy
console.log( state.todos ); // []
console.log( state.status ); // 'ready'
// But it is not possible to
// update the state directly
state.status = 'loading';
console.log( state.status ); // 'ready'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment