Revize 8bb5689a
Přidáno uživatelem Michal Schwob před více než 1 rok
src/stores/store.ts | ||
---|---|---|
1 | 1 |
import { configureStore } from "@reduxjs/toolkit" |
2 |
import { persistStore } from "redux-persist" |
|
2 | 3 |
import userReducer from "./reducers/userSlice" |
3 | 4 |
import itemReducer from "./reducers/itemSlice" |
4 | 5 |
import searchFormReducer from "./reducers/searchFormSlice" |
... | ... | |
6 | 7 |
import homePageReducer from "./reducers/homePageSlice" |
7 | 8 |
import noteViewReducer from "./reducers/notesSlice" |
8 | 9 |
|
9 |
const store = configureStore({ |
|
10 |
export const store = configureStore({
|
|
10 | 11 |
reducer: { |
11 | 12 |
user: userReducer, |
12 | 13 |
itemViewState: itemReducer, |
... | ... | |
17 | 18 |
}, |
18 | 19 |
}) |
19 | 20 |
|
20 |
export default store |
|
21 |
export const Persistor = persistStore(store) |
|
22 |
|
|
23 |
export default { store, Persistor } |
|
21 | 24 |
export type RootState = ReturnType<typeof store.getState> |
22 | 25 |
export type AppStore = typeof store |
23 | 26 |
export type AppDispatch = typeof store.dispatch |
Také k dispozici: Unified diff
Added persistor storage to save app state
re #10821