index.js 529 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. exports.__esModule = true;
  3. function createThunkMiddleware(extraArgument) {
  4. return function (_ref) {
  5. var dispatch = _ref.dispatch,
  6. getState = _ref.getState;
  7. return function (next) {
  8. return function (action) {
  9. if (typeof action === 'function') {
  10. return action(dispatch, getState, extraArgument);
  11. }
  12. return next(action);
  13. };
  14. };
  15. };
  16. }
  17. var thunk = createThunkMiddleware();
  18. thunk.withExtraArgument = createThunkMiddleware;
  19. exports['default'] = thunk;