redux-thunk
Version:
Thunk middleware for Redux.
17 lines (13 loc) • 375 B
JavaScript
;
exports.__esModule = true;
exports['default'] = thunkMiddleware;
function thunkMiddleware(_ref) {
var dispatch = _ref.dispatch;
var getState = _ref.getState;
return function (next) {
return function (action) {
return typeof action === 'function' ? action(dispatch, getState) : next(action);
};
};
}
module.exports = exports['default'];