Projekt

Obecné

Profil

Stáhnout (680 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1 c7d2ced1 Václav Honzík
2 37f6ff02 Vaclav Honzik
import { applyMiddleware, combineReducers, createStore } from 'redux'
3 a69da1e3 Vaclav Honzik
import { persistStore } from 'redux-persist'
4 37f6ff02 Vaclav Honzik
import thunk from 'redux-thunk'
5 8370b6c1 Vaclav Honzik
import userReducer from '../Auth/userSlice'
6 c7d2ced1 Václav Honzík
import themeReducer from '../Theme/themeReducer'
7
8 8042e8b3 Vaclav Honzik
9 a69da1e3 Vaclav Honzik
// Store holds shared state in the application
10 c7d2ced1 Václav Honzík
const store = createStore(
11 4a2ac9a8 Vaclav Honzik
    combineReducers({ user: userReducer, theme: themeReducer }),
12 37f6ff02 Vaclav Honzik
    applyMiddleware(thunk) // Thunk middleware so we can async fetch data from the api
13 c7d2ced1 Václav Honzík
)
14
15
export default store
16 a69da1e3 Vaclav Honzik
export const persistor = persistStore(store)
17 c7d2ced1 Václav Honzík
export type AppStore = typeof store
18
export type RootState = ReturnType<typeof store.getState>
19
export type AppDispatch = typeof store.dispatch