We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ccb25f1 commit 6ef0d42Copy full SHA for 6ef0d42
index.d.ts
@@ -17,6 +17,17 @@ export interface Action {
17
type: any;
18
}
19
20
+/**
21
+ * An Action type which accepts any other properties.
22
+ * This is mainly for the use of the `Reducer` type.
23
+ * This is not part of `Action` itself to prevent users who are extending `Action.
24
+ * @private
25
+ */
26
+export interface AnyAction extends Action {
27
+ // Allows any extra properties to be defined in an action.
28
+ [extraProps: string]: any;
29
+}
30
+
31
32
/* reducers */
33
@@ -43,7 +54,7 @@ export interface Action {
43
54
*
44
55
* @template S State object type.
45
56
*/
46
-export type Reducer<S> = <A extends Action>(state: S, action: A) => S;
57
+export type Reducer<S> = (state: S, action: AnyAction) => S;
47
58
48
59
/**
49
60
* Object whose values correspond to different reducer functions.
0 commit comments