Skip to content

Instantly share code, notes, and snippets.

@pubudu-ranasinghe
Created May 26, 2021 13:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pubudu-ranasinghe/345e408af71ff5fc94acba5109fbb50d to your computer and use it in GitHub Desktop.
Save pubudu-ranasinghe/345e408af71ff5fc94acba5109fbb50d to your computer and use it in GitHub Desktop.
redux-in-2021-01
import { combineReducers } from 'redux'
import userReducer from './reducers/userReducer'
import orderReducer from './reducers/orderReducer'
const rootReducer = combineReducers({
users: userReducer,
orders: orderReducer
})
export default rootReducer
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