fluxible-redux-dispatcher
Use redux style action creators and thunks with fluxible. Meant for easing the porting from fluxible to redux. Use in conjunction with
fluxible-reducer-store
Installation
npm install fluxible-redux-dispatcher
Usage
const createDispatcher createHandler = ;const actionCreator = { return type: 'REDUX_ACTION' payload ;};const thunk = { // note the getStore instead of the normal `getState` return { ; };}; // within a fluxible action { const dispatch = ; ; ;} // within a react componentComponent { superprops; thishandlerOne = ; thishandlerTwo = ; } // ...
NOTE:
You cannot create the handlers in Fluxible's connectToStores
because the context that gets passed in does not have executeAction
defined. I could create a new connect
method that would combine the functionality of Redux's connect
and Fluxible's connectToStores
to reduce the need to keep calling createHandler for each handler a component would have but this package isn't meant to be full-fledged, it's just to help with porting from Fluxible to Redux.