Skip to content

Commit 6107a49

Browse files
feat(overmind): return instance from send
1 parent c1caed8 commit 6107a49

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/node_modules/overmind/src/statemachine.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface MachineMethods<States extends TState, Events extends TEvents> {
2525
): Statemachine<States extends { current: T} ? States : never, Events> | undefined
2626
send<T extends Events["type"]>(
2727
...args: Events extends { type: T, data: any } ? [T, Events["data"]] : [T]
28-
): Statemachine<States extends { current: T} ? States : never, Events> | undefined
28+
): Statemachine<States extends { current: T} ? States : never, Events>
2929
}
3030

3131
export type Statemachine<States extends TState, Events extends TEvents> = States & MachineMethods<States, Events>
@@ -63,7 +63,7 @@ export class StateMachine<State extends TState, Events extends TEvents> {
6363
if (process.env.NODE_ENV === 'development') {
6464
console.warn(`Overmind - The statemachine at "${this[PATH]}" has been disposed, but you tried to transition on it`)
6565
}
66-
return
66+
return this
6767
}
6868

6969
const transition = this[VALUE][TRANSITIONS][type]
@@ -74,7 +74,7 @@ export class StateMachine<State extends TState, Events extends TEvents> {
7474
this.current = result
7575
}
7676

77-
return
77+
return this
7878
}
7979
matches(state: any) {
8080
if (this.current === state) {

0 commit comments

Comments
 (0)