Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. const triggerDispatchs = action => {
  2. const dispatchs = [counterDispatch, authDispatch];
  3. for (let i = 0; i < dispatchs.length; i++) {
  4. dispatchs[i](action);
  5. }
  6. };
  7.  
  8. const middlewareContrutor = action => {
  9. middleware(action)(triggerDispatchs);
  10. };
  11.  
  12. const combinedReducers = {
  13. store: {
  14. ...counterState,
  15. ...authState
  16. },
  17. dispatch: middlewareContrutor
  18. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement