This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
Sphere/app/middleware/actionChain.js

10 lines
254 B
JavaScript
Raw Normal View History

2016-05-02 21:07:07 +01:00
export default store => next => action => {
if (action.meta &&
action.meta.callback &&
action.type.endsWith('SUCCESS') &&
typeof action.meta.callback === 'function') {
2016-05-05 13:34:10 +01:00
action.meta.callback(action.payload);
2016-05-02 21:07:07 +01:00
}
return next(action);
};