https://github.com/rt2zz/redux-persist显示以下代码片段
const persistedReducer = persistReducer(persistConfig, rootReducer)
export default () => {
let store = createStore(persistedReducer)
let persistor = persistStore(store)
return { store, persistor }
}
您可以改为这样做,两者之间有什么区别?
const persistedReducer = persistReducer(persistConfig, rootReducer)
let store = createStore(persistedReducer)
let persistor = persistStore(store)
export { store, persistor }
编辑
更重要的是,为什么要使用第一种形式而不是第二种形式?
DIEA
扬帆大鱼
相关分类