Redux thunk源码 发表于 2017-05-24 | 分类于 redux 1 redux-thunk源码1234567891011121314151617181920212223'use strict';exports.__esModule = true;function createThunkMiddleware(extraArgument) { return function (_ref) { var dispatch = _ref.dispatch, getState = _ref.getState; return function (next) { return function (action) { if (typeof action === 'function') { return action(dispatch, getState, extraArgument); } return next(action); }; }; };}var thunk = createThunkMiddleware();thunk.withExtraArgument = createThunkMiddleware;exports['default'] = thunk; 什么是thunk 123// Meet thunks.// A thunk is a function that returns a function.// This is a thunk. redux-thunk