Node.js Package for attaching callback functions to redux messages.
redux-maybe is using redux-observable to attach callbacks. It's basically an epic which listens for the "CALL_ME_MAYBE" action including a actiontype to listen for, a callback and a number of times to repeat the callback.
The name is designed to make Carly Rae Jepsens' hit song start playing in your brain everytime you use the package.
Before you start using this package, you are advised to know you way around both redux and redux-observables.
To install the package
npm install --save redux-maybe
import { myReducers } from './myReducers';
import { createStore } from 'redux';
import { createEpicMiddleware } from 'redux-observable';
import { maybeEpic, callMeMaybe } from 'redux-maybe';
//Import RXJS in order to make redux-observable happy
import 'rxjs';
const epicMiddleware = createEpicMiddleware(maybeEpic);
const store = createStore(myReducers,applyMiddleware(epicMiddleware));
store.dispatch(callMeMaybe("TEST_ACTION", () => console.log("CALLED_MAYBE"),1));
store.dispatch({type:"TEST_ACTION"});
CALLED_MAYBE
This project is licensed under the MIT License - see the LICENSE file for details