我想将一个参数传递给一个自定义的 Redux 中间件。但我不知道如何在自定义中间件中使用参数。
例子:
import { createStore, applyMiddleware } from 'redux';
import reducers from './reducers';
const customMiddleWare = store => next => action => {
// how to use argument here?
};
const middlewares = [customMiddleWare(argument)];
const store = createStore(
reducers,
applyMiddleware(...middlewares)
);