Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1c710f4f

Přidáno uživatelem Václav Honzík před asi 2 roky(ů)

filter functional

re #9545

Zobrazit rozdíly:

frontend/src/features/redux/store.ts
1

  
2 1
import { applyMiddleware, combineReducers, createStore } from 'redux'
3 2
import { persistStore } from 'redux-persist'
4 3
import thunk from 'redux-thunk'
5 4
import userReducer from '../Auth/userSlice'
6 5
import themeReducer from '../Theme/themeReducer'
7 6
import catalogReducer from '../Catalog/catalogSlice'
7
import { composeWithDevTools } from 'redux-devtools-extension'
8 8

  
9
const composeEnhancers = composeWithDevTools({})
9 10

  
10 11
// Store holds shared state in the application
11 12
const store = createStore(
12
    combineReducers({ user: userReducer, theme: themeReducer, catalog: catalogReducer }),
13
    applyMiddleware(thunk) // Thunk middleware so we can async fetch data from the api
13
    combineReducers({
14
        user: userReducer,
15
        theme: themeReducer,
16
        catalog: catalogReducer,
17
    }),
18
    process.env.REACT_APP_DEV_ENV === 'true'
19
        ? composeEnhancers(
20
              applyMiddleware(thunk) // Thunk middleware so we can async fetch data from the api
21
          )
22
        : applyMiddleware(thunk)
14 23
)
15 24

  
16 25
export default store

Také k dispozici: Unified diff