Created
February 12, 2014 19:45
-
-
Save staydecent/8963096 to your computer and use it in GitHub Desktop.
Re-render React component on stapes module change event
This file contains 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 Module = Stapes.subclass(); | |
var mod = new Module(); | |
function initRender() { | |
// MyApp would be some Reacy component you've defined | |
React.renderComponent(<MyApp mod={mod} />, node); | |
} | |
// ready is a custom event to trigger initRender | |
// from the Module contructor | |
mod.on('ready', initRender); | |
// ex. mod.push(['thing1', 'thing2']) would trigger this | |
mod.on('change', initRender); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment