react-hoodie
React Hoodie bindings. Inspired by react-redux and re-base.
It's similar to Redux in that:
- there is one true store
- writes are dispatched as tasks
And similar to re-base in that:
- you explicitly bind data to component state
Plus, thanks to Hoodie it:
- works offline (properly, i.e.: writes and first load)
- syncs in realtime across multiple clients
Usage
Wrap your app in a hoodie:
var hoodie = url: 'http://localhost:8080'// hoodie.account.signIn({...}) etc. ReactDOM;
Bind hoodie data to component state and write to the hoodie store:
; { superprops context thishoodie = contexthoodie; thisstate = 'todos': ; } { thistodos = thishoodie; } { thistodos; } { thistodos; } { var { return <li key=itemid>itemtitle</li>; }; return <div className="App"> <h2>Welcome to React Hoodie!</h2> <ul>thisstatetodos</ul> <button onClick=thisaddTodo> + Add todo</button> </div> ; } AppcontextTypes = hoodie: ReactPropTypesany