react-redux-pledge
Version:
Enhance your connected component by rendering them only when their props are guaranteed
20 lines (16 loc) • 432 B
JavaScript
import {
find as _find,
isequal as _isequal
} from 'lodash'
import { RESOLVE_PLEDGES_ACTION } from './actionType'
let actionsAlreadyPut = {}
const pledgesMiddleware = ({ dispatch }) => next => action => {
if (action.type == RESOLVE_PLEDGES_ACTION) {
const { actions } = action
for (let a of actions) {
dispatch(a)
}
}
return next(action)
}
export default pledgesMiddleware