Created
April 24, 2017 14:31
-
-
Save mushfiqweb/5ad24f26ed7ea9b7dd084f9716f89ce6 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
/* 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