You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Initialize redux state asynchronously with multiple async actions.
Install
npminstall--saveredux-dispatch-monitor
Usage
import{createStore,applyMiddleware,compose}from"redux";importmonitorfrom"redux-dispatch-monitor";importthunkfrom"redux-thunk";importcustomizedMiddlewarefrom"./middlewares/customized";importrootReducersfrom"./reducers";import{action1,action2,actionN}from"./actions";constmiddlewares=[thunk,customizedMiddleware];constinitActions=[action1(params),action2(params),actionN(params)];constenhancer=compose(monitor,applyMiddleware(...middlewares));conststore=createStore(rootReducers,enhancer);monitor.dispatch(...initActions).done((preloadedState)=>{// do some things initializing})
About
Initialize redux state asynchronously with multiple async actions.