Skip to content

Commit 6e93e5c

Browse files
committed
refactor(overmind): switch order of Effects and State on ActionsCallback type
1 parent 4cb01f5 commit 6e93e5c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/node_modules/overmind/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export interface Events {
5454
}
5555
}
5656

57-
export type ActionsCallback<Effects, State> = (
57+
export type ActionsCallback<State, Effects> = (
5858
action: TAction<State, Effects & { state: State }>
5959
) => any
6060

@@ -82,15 +82,15 @@ export default class App<
8282
[namespace: string]: ReactionsCallback<State, any>
8383
},
8484
Actions extends
85-
| ActionsCallback<Effects, State>
85+
| ActionsCallback<State, Effects>
8686
| {
8787
[namespace: string]: ActionsCallback<{}, {}>
8888
}
8989
> {
9090
private proxyStateTree: ProxyStateTree
9191
private eventHub: EventEmitter<Events>
9292
devtools: Devtools
93-
actions: Actions extends ActionsCallback<Effects, State>
93+
actions: Actions extends ActionsCallback<State, Effects>
9494
? ReturnType<Actions>
9595
: Actions extends {
9696
[namespace: string]: ActionsCallback<{}, {}>
@@ -325,7 +325,7 @@ export default class App<
325325
private getActions(configuration, action) {
326326
const actions =
327327
typeof configuration.actions === 'function'
328-
? (configuration.actions as ActionsCallback<Effects, State>)(
328+
? (configuration.actions as ActionsCallback<State, Effects>)(
329329
action as TAction<State, Effects & { state: State }>
330330
)
331331
: (Object.keys(configuration.actions || {}).reduce(

packages/node_modules/overmind/src/views/react.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ export default class ReactApp<
3131
Reactions extends ReactionsCallback<State, any>,
3232
Actions extends
3333
| {
34-
[namespace: string]: ActionsCallback<Providers, State>
34+
[namespace: string]: ActionsCallback<State, Providers>
3535
}
36-
| ActionsCallback<Providers, State>
36+
| ActionsCallback<State, Providers>
3737
> extends App<State, Providers, Reactions, Actions> {
3838
connect = <
3939
Props,

0 commit comments

Comments
 (0)