如何使用redux saga运行redux devtools?

问题描述 投票:3回答:3

尝试使用redux saga运行reduxdevtools:

出现此错误:

Error
Before running a Saga, you must mount the Saga middleware on the Store using applyMiddleware

这是我的jscode:

const store = createStore(
  reducer,
  applyMiddleware(sagaMiddleware),
  window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
);

如何使用saga运行此devtool?或者,否则会起作用吗?codepen

redux react-redux redux-saga
3个回答

1
投票
先前的答案(由trkaplan使用)使用了从'redux-devtools-extension'包中导入的composeWithDevTools方法。如果您不想安装此软件包,则可以使用以下代码(基于the docs):

0
投票
如果使用Redux的撰写。然后下面的代码很有用。步骤1:添加chrome Redux DevTools扩展。步骤2:npm安装redux-devtools-extension。
© www.soinside.com 2019 - 2024. All rights reserved.