Last active
September 19, 2015 13:03
-
-
Save arqex/095e6528f7b514c0c63b to your computer and use it in GitHub Desktop.
Todomvc
This file contains hidden or 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
var state = freezer.get(); | |
// this will replace app state for a new one | |
state.todos.push({ | |
model: {id: 1, title: 'Do this.', completed: false}, | |
ui: {status: 'ready', input: 'Do this.'} | |
}); | |
// state variable is still unchanged, | |
// it is immutable | |
console.log( state.todos ); // [] | |
// but the state has changed | |
state === freezer.get(); // false | |
// our data is in the new state | |
console.log( freezer.get().todos.length ); // 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment