governorjs
State manager courtesy of React.addons.update
Example
var React = var Governor = var { { state } hub} var Message = React var MessageInput = React Governor
API
create :: (Object) -> Object
var stateManager = Governor
pureRenderMixin :: (str str ...etc) -> react-mixin-object
var mixin = Governor
The above mixin, when mixed into a component, would cause it to only rerender if its incoming "foo" or "zap" property was changed from the last render (using ===
).
Store interface
A store is just a function.
This function will receive 2 arguments, the first, an object containing get
and set
methods, used to update the store's state, and the second, a reference to an event hub that it can listen to for relevant events.
set
uses React.addons.update, documented here.