Skip to content

Instantly share code, notes, and snippets.

@derveloper
Created July 6, 2016 19:06
Show Gist options
  • Save derveloper/e74480aaf38a765cb3d4e37063f69350 to your computer and use it in GitHub Desktop.
Save derveloper/e74480aaf38a765cb3d4e37063f69350 to your computer and use it in GitHub Desktop.
kiste bier ist mir
fooDispatch function dispatch(action) {
return _dispatch(action);
}
store.js?5dc3:13fooNext function (action) {
console.log("barDispatch", dispatch.toString());
console.log("barNext", next.toString());
next(action);
}
store.js?5dc3:17barDispatch function dispatch(action) {
return _dispatch(action);
}
store.js?5dc3:18barNext function (action) {
console.log("bazDispatch", dispatch.toString());
console.log("bazNext", next.toString());
next(action);
}
store.js?5dc3:22bazDispatch function dispatch(action) {
return _dispatch(action);
}
store.js?5dc3:23bazNext function dispatch(action) {
liftedStore.dispatch(liftAction(action));
return action;
}
const store = createStore(rootReducer, initialState, compose(
applyMiddleware(thunk),
applyMiddleware(routerMiddleware(browserHistory),
({dispatch}) => next => action => {
console.log("fooDispatch", dispatch.toString());
console.log("fooNext", next.toString());
next(action);
},
({dispatch}) => next => action => {
console.log("barDispatch", dispatch.toString());
console.log("barNext", next.toString());
next(action);
},
({dispatch}) => next => action => {
console.log("bazDispatch", dispatch.toString());
console.log("bazNext", next.toString());
next(action);
}
),
@fuglu
Copy link

fuglu commented Jul 6, 2016

Tatsächlich heißt erst die letzte Funktion wieder dispatch()
https://gist.github.com/fuglu/8f3ad35e362f859a415e34e36ab291b1

🍻 kommt!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment