Created
April 24, 2017 14:27
-
-
Save mushfiqweb/3c194febf277f31c2f39bf3966f5da7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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