Skip to content

Instantly share code, notes, and snippets.

@arqex
Last active September 19, 2015 14:45
Show Gist options
  • Save arqex/05b2e10ae05a0e3eb053 to your computer and use it in GitHub Desktop.
Save arqex/05b2e10ae05a0e3eb053 to your computer and use it in GitHub Desktop.
/* FREEZER */
// Create a reaction
freezer.on('todo:update', function( todo, text ){
todo.model.set({title: text});
});
// Trigger the event from your component
var TodoList = React.createComponent({
...
updateTodo: function( todo, text ){
// Emit an event, pass all the arguments needed
freezer.trigger('todo:update', todo, text );
}
...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment