https://github.com/rt2zz/redux-persist showcases the code snippet below:
const persistedReducer = persistReducer(persistConfig, rootReducer)
export default () => {
let store = createStore(persistedReducer)
let persistor = persistStore(store)
return { store, persistor }
}
The alternative approach is as follows, with a question about the differences:
const persistedReducer = persistReducer(persistConfig, rootReducer)
let store = createStore(persistedReducer)
let persistor = persistStore(store)
export { store, persistor }
- EDIT
Moreover, what reasons might prompt someone to opt for the first structure over the second?