在我的商店设置中将serializeAction设置为true时出现问题

时间:2019-04-30 15:02:26

标签: reactjs typescript redux react-redux

不确定如何在serializeAction中将true设置为enhancer 我尝试添加:

const composeEnhancers =
   (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ &&
   (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({
     serializeAction: true
 });

但是不确定如何将其添加到enhancer中,我试图这样设置增强器: const enhancer = composeWithDevTools(applyMiddleware(...middlewares)) && composeEnhancers运气不好。

这是我当前的设置:

const createStoreWithApi = (api: IApi, initialState?: {}) => {
  const middlewares = [
    thunkMiddleware.withExtraArgument({
      api
    })
  ];
  const enhancer = composeWithDevTools(applyMiddleware(...middlewares));
  return createStore(rootReducer, initialState!, enhancer);
};

会喜欢一些建议

0 个答案:

没有答案