Last active
September 19, 2015 13:04
-
-
Save arqex/5f675c10e416e9401f4e 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
var TodoApp = React.createClass({ | |
componentDidMount: function () { | |
var me = this; | |
// Here the magic happens. Everytime that the | |
// state is updated the app will re-render. | |
// A real data driven app. | |
freezer.on('update', function(){ | |
me.forceUpdate(); | |
}); | |
}, | |
render: function() { | |
var state = freezer.get(); | |
return <TodoList todos={ state.todos } /> | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment