diff --git a/src/combineReducers.ts b/src/combineReducers.ts index 07f9f7bd22..4c9f2f9b63 100644 --- a/src/combineReducers.ts +++ b/src/combineReducers.ts @@ -130,7 +130,7 @@ export default function combineReducers( export default function combineReducers( reducers: ReducersMapObject ): Reducer, A> -export default function combineReducers>( +export default function combineReducers( reducers: M ): Reducer< CombinedState>, diff --git a/src/types/reducers.ts b/src/types/reducers.ts index d0c41a9d33..22cc05a76b 100644 --- a/src/types/reducers.ts +++ b/src/types/reducers.ts @@ -36,7 +36,7 @@ export type Reducer = ( * * @template A The type of actions the reducers can potentially respond to. */ -export type ReducersMapObject = { +export type ReducersMapObject = { [K in keyof S]: Reducer } @@ -45,10 +45,7 @@ export type ReducersMapObject = { * * @template M Object map of reducers as provided to `combineReducers(map: M)`. */ -export type StateFromReducersMapObject = M extends ReducersMapObject< - any, - any -> +export type StateFromReducersMapObject = M extends ReducersMapObject ? { [P in keyof M]: M[P] extends Reducer ? S : never } : never