Skip to content

Commit 3df3d57

Browse files
committed
fix(overmind): match actions in ResolveAction
1 parent ed2edf2 commit 3df3d57

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

packages/node_modules/overmind/src/internalTypes.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,30 @@ export type ResolveAction<T> = T extends IOperator<void, infer R>
172172
: never
173173

174174
export interface ContextFunction<P extends any, R extends any> {
175-
(context: { state: any; actions: any; effects: any }, payload: P): R
175+
(
176+
context: {
177+
state: any
178+
actions: any
179+
effects: any
180+
reaction: any
181+
addMutationListener: any
182+
addFlushListener: any
183+
},
184+
payload: P
185+
): R
176186
}
177187

178188
// This resolves promises to its values, cause that is how operators work
179189
export interface OperatorContextFunction<P extends any, R extends any> {
180190
(
181-
context: { state: any; actions: any; effects: any },
191+
context: {
192+
state: any
193+
actions: any
194+
effects: any
195+
reaction: any
196+
addMutationListener: any
197+
addFlushListener: any
198+
},
182199
payload: P extends Promise<infer PP> ? PP : P
183200
): R
184201
}

0 commit comments

Comments
 (0)