Skip to content

Instantly share code, notes, and snippets.

@alexmochu
Last active July 22, 2020 18:04
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 alexmochu/8e39160ea410e8f18b51aabc2be38023 to your computer and use it in GitHub Desktop.
Save alexmochu/8e39160ea410e8f18b51aabc2be38023 to your computer and use it in GitHub Desktop.
import { combineReducers } from '@reduxjs/toolkit'
import clicksReducer from './counter'
const clicks = { count: clicksReducer }
export let rootReducer = combineReducers({
...clicks
})
export default function createReducer(injectedReducers = {}) {
rootReducer = combineReducers({
...clicks,
...injectedReducers,
});
return rootReducer;
}
export type RootState = ReturnType<typeof rootReducer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment