Created
April 24, 2017 14:29
-
-
Save mushfiqweb/cf049b3091b1228b2ef8a08d29b23694 to your computer and use it in GitHub Desktop.
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 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