Skip to content

Commit d374e9d

Browse files
committed
Make Reducer more polymorphic
1 parent 1be2694 commit d374e9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export interface Action<T = any> {
4646
* @template S The type of state consumed and produced by this reducer.
4747
* @template A The type of actions the reducer can potentially respond to.
4848
*/
49-
export type Reducer<S = {}, A extends Action = Action> = (state: S, action: A) => S;
49+
export type Reducer<S = {}, A extends Action = Action> = <Act extends A>(state: S, action: Act) => S;
5050

5151
/**
5252
* Object whose values correspond to different reducer functions.

0 commit comments

Comments
 (0)