Created
May 26, 2021 13:15
-
-
Save pubudu-ranasinghe/345e408af71ff5fc94acba5109fbb50d to your computer and use it in GitHub Desktop.
redux-in-2021-01
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { combineReducers } from 'redux' | |
import userReducer from './reducers/userReducer' | |
import orderReducer from './reducers/orderReducer' | |
const rootReducer = combineReducers({ | |
users: userReducer, | |
orders: orderReducer | |
}) | |
export default rootReducer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createStore, applyMiddleware } from 'redux' | |
import thunkMiddleware from 'redux-thunk' | |
import { composeWithDevTools } from 'redux-devtools-extension' | |
import rootReducer from './rootReducer' | |
const composedEnhancer = composeWithDevTools(applyMiddleware(thunkMiddleware)) | |
const store = createStore(rootReducer, composedEnhancer) | |
export default store |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment