Skip to content

Instantly share code, notes, and snippets.

@staydecent
Created February 12, 2014 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save staydecent/8963096 to your computer and use it in GitHub Desktop.
Save staydecent/8963096 to your computer and use it in GitHub Desktop.
Re-render React component on stapes module change event
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