Methodes
constructor({ns:String, intialState:Object})
/**
* Create an RxStore instance
* @param {Object} opts
* @param {String} opts.ns The namespace of the store. Debuggin purpose. Default: 'rxStore'
* @param {Object} opts.initialState Initial state of the store. Default: {}
*
* @returns {RxStore} A new RxStore instance
*/
constructor({ ns = 'rxStore', initialState = {} } = {})Example
import RxStore from '@zazapeta/rx-react-store';
const ns = 'Todo';
const initialState = {
todos: []
};
const todoStore = new RxStore({ ns, initialState });
export default todoStore;async dispatch(reducer:Function, ...rest)
createDispatcher(reducer:Function): Function
createDispatchers(reducersMap:Object{String,Function}):Object{String, Function}
connect(mapStateToProps:Function(state, props)->Object)(BaseComponent:Component):Component
Last updated