Projekt

Obecné

Profil

Stáhnout (681 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 a69da1e3 Vaclav Honzik
import userReducer from '../Auth/userReducer'
6 c7d2ced1 Václav Honzík
import themeReducer from '../Theme/themeReducer'
7
8 a69da1e3 Vaclav Honzik
// Store holds shared state in the application
9 c7d2ced1 Václav Honzík
const store = createStore(
10 a69da1e3 Vaclav Honzik
    combineReducers({ user: userReducer, theme: themeReducer }),
11 37f6ff02 Vaclav Honzik
    applyMiddleware(thunk) // Thunk middleware so we can async fetch data from the api
12 c7d2ced1 Václav Honzík
)
13
14
export default store
15 a69da1e3 Vaclav Honzik
export const persistor = persistStore(store)
16 c7d2ced1 Václav Honzík
export type AppStore = typeof store
17
export type RootState = ReturnType<typeof store.getState>
18
export type AppDispatch = typeof store.dispatch