Skip to content

Commit 4246935

Browse files
fix(overmind): typing issue with statemachine transitions
1 parent 610ed57 commit 4246935

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/node_modules/overmind/src/statemachine.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { PROXY_TREE, VALUE } from 'proxy-state-tree'
22

3-
import { Derive } from './'
4-
53
export type StatemachineDefinition<States extends string> = {
64
initial: States,
75
states: {
@@ -13,7 +11,7 @@ export type Statemachine<States extends string> = {
1311
current: States
1412
reset: () => void
1513
} & {
16-
[State in States]: <T>(entry?: () => T, exit?: () => void) => T
14+
[State in States]: <T extends () => any>(entry?: T, exit?: () => void) => T extends () => infer U ? U : void
1715
}
1816

1917
const CURRENT_EXIT = Symbol('CURRENT_EXIT')

0 commit comments

Comments
 (0)