Projekt

Obecné

Profil

Stáhnout (681 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1

    
2
import { applyMiddleware, combineReducers, createStore } from 'redux'
3
import { persistStore } from 'redux-persist'
4
import thunk from 'redux-thunk'
5
import userReducer from '../Auth/userReducer'
6
import themeReducer from '../Theme/themeReducer'
7

    
8
// Store holds shared state in the application
9
const store = createStore(
10
    combineReducers({ user: userReducer, theme: themeReducer }),
11
    applyMiddleware(thunk) // Thunk middleware so we can async fetch data from the api
12
)
13

    
14
export default store
15
export const persistor = persistStore(store)
16
export type AppStore = typeof store
17
export type RootState = ReturnType<typeof store.getState>
18
export type AppDispatch = typeof store.dispatch
    (1-1/1)