我对文档感到困惑。我正在尝试使用Redux-storage中间件,这就是他们显示商店是使用中间件创建的方式:
const middleware = storage.createMiddleware(engine);
const createStoreWithMiddleware = applyMiddleware(middleware)(createStore);
const store = createStoreWithMiddleware(reducer);
但是Redux 文档显示了这一点:
let store = createStore(
todos,
[ 'Use Redux' ], // How do I put here the data from the redux-storage?
applyMiddleware(middleware) // here goes the redux-storage
)
createStore
需要传递初始存储值,但我无法在没有存储的情况下加载存储的值。这是一种捕获 22。我在这里错过了什么?