Yet another flux implementation, with bindings for react. Built over react's new context API.
Wrap ReState over your root component.
;<ReStatestore=initialState // initial state of your storeapplyMiddleWare=fetchDataMiddleWare // Optional, Allows managing side-effects><App /></ReState>
That's it, now any child component can connect to store.
;const App =<div><button onClick=buttonClick > Fire Action! </button></div>;const mapStateToProps =...stateconst mapDispatchToProps =mapStateToProps mapDispatchToPropsApp
This the best part. You can pass any function (middleware) to the applyMiddleWare prop, and it will be fired with every action.
// Handling async with middlewareactiontype === 'FETCH_DATA' &&