Skip to content

Instantly share code, notes, and snippets.

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