Skip to content

Commit 78716bf

Browse files
authored
Fix combineReducers typings. (#3679)
1 parent 032d936 commit 78716bf

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/combineReducers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export default function combineReducers<S>(
130130
export default function combineReducers<S, A extends Action = AnyAction>(
131131
reducers: ReducersMapObject<S, A>
132132
): Reducer<CombinedState<S>, A>
133-
export default function combineReducers<M extends ReducersMapObject<any, any>>(
133+
export default function combineReducers<M extends ReducersMapObject>(
134134
reducers: M
135135
): Reducer<
136136
CombinedState<StateFromReducersMapObject<M>>,

src/types/reducers.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export type Reducer<S = any, A extends Action = AnyAction> = (
3636
*
3737
* @template A The type of actions the reducers can potentially respond to.
3838
*/
39-
export type ReducersMapObject<S = any, A extends Action = Action> = {
39+
export type ReducersMapObject<S = any, A extends Action = AnyAction> = {
4040
[K in keyof S]: Reducer<S[K], A>
4141
}
4242

@@ -45,10 +45,7 @@ export type ReducersMapObject<S = any, A extends Action = Action> = {
4545
*
4646
* @template M Object map of reducers as provided to `combineReducers(map: M)`.
4747
*/
48-
export type StateFromReducersMapObject<M> = M extends ReducersMapObject<
49-
any,
50-
any
51-
>
48+
export type StateFromReducersMapObject<M> = M extends ReducersMapObject
5249
? { [P in keyof M]: M[P] extends Reducer<infer S, any> ? S : never }
5350
: never
5451

0 commit comments

Comments
 (0)