Skip to content

Commit f672662

Browse files
feat(overmind): adjust to using right hand typing of actions
1 parent 2cff676 commit f672662

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

packages/node_modules/overmind/src/config/config.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe('Config', () => {
6767

6868
return Promise.all([
6969
app.actions.lazy.loadConfig('configA'),
70-
app.actions.loadConfigB({}),
70+
app.actions.loadConfigB(),
7171
]).then(() => {
7272
// @ts-ignore
7373
expect(app.state.configA.foo).toEqual('bar')

packages/node_modules/overmind/src/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ describe('Overmind', () => {
193193
type: 'action',
194194
})
195195
})
196-
app.actions.doThis({})
196+
app.actions.doThis()
197197
})
198198
test('should track operator start and end', () => {
199199
expect.assertions(2)
@@ -227,7 +227,7 @@ describe('Overmind', () => {
227227
type: 'action',
228228
})
229229
})
230-
app.actions.doThis({})
230+
app.actions.doThis()
231231
})
232232
test('should track mutations', () => {
233233
expect.assertions(1)

packages/node_modules/overmind/src/internalTypes.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
ITrackStateTree,
66
} from 'proxy-state-tree'
77

8-
import { IAction, IOperator } from './types'
8+
import { IAction, IOperator, IContext } from './types'
99

1010
export type SubType<Base, Condition> = Pick<
1111
Base,
@@ -173,11 +173,11 @@ export type ResolveActions<
173173
? {}
174174
: {
175175
[T in keyof Actions]: Actions[T] extends IOperator<any, any, any>
176-
? TActionValue<Actions[T]> extends void
176+
? Actions[T] extends (context: IContext<any>, value: void) => any
177177
? () => Promise<void>
178178
: (value: TActionValue<Actions[T]>) => Promise<void>
179179
: Actions[T] extends IAction<any, any, any>
180-
? TActionValue<Actions[T]> extends void
180+
? Actions[T] extends (context: IContext<any>, value: void) => any
181181
? () => ReturnType<Actions[T]>
182182
: (value: TActionValue<Actions[T]>) => ReturnType<Actions[T]>
183183
: Actions[T] extends NestedActions
@@ -202,11 +202,11 @@ export type ResolveMockActions<
202202
? {}
203203
: {
204204
[T in keyof Actions]: Actions[T] extends IOperator<any, any, any>
205-
? TActionValue<Actions[T]> extends void
205+
? Actions[T] extends (context: IContext<any>, value: void) => any
206206
? () => Promise<MockResult>
207207
: (value: TActionValue<Actions[T]>) => Promise<MockResult>
208208
: Actions[T] extends IAction<any, any, any>
209-
? TActionValue<Actions[T]> extends void
209+
? Actions[T] extends (context: IContext<any>, value: void) => any
210210
? () => Promise<MockResult>
211211
: (value: TActionValue<Actions[T]>) => Promise<MockResult>
212212
: Actions[T] extends NestedMockActions

0 commit comments

Comments
 (0)