Skip to content

Instantly share code, notes, and snippets.

@arqex
Last active September 19, 2015 13:04
Show Gist options
  • Save arqex/5f675c10e416e9401f4e to your computer and use it in GitHub Desktop.
Save arqex/5f675c10e416e9401f4e 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