Skip to content

Instantly share code, notes, and snippets.

@alexmochu
Created July 24, 2020 10:53
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/abaf7bafb1c269dfb19054b85b9d3d56 to your computer and use it in GitHub Desktop.
Save alexmochu/abaf7bafb1c269dfb19054b85b9d3d56 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