Skip to content

Commit b20d4e5

Browse files
refactor(overmind): add warning in dev on invalid state transitions
1 parent 9c6420d commit b20d4e5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/node_modules/overmind/src/statemachine.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ class StateMachine<States extends TStates, State extends TStates = States> {
6666
}
6767

6868
return exitResult || entryResult
69+
} else if (process.env.NODE_ENV === 'development') {
70+
console.warn(`Overmind Statemachine - You tried to transition into "${state}", but it is not a valid transition. The valid transitions are ${JSON.stringify(transitions[this.state])}`)
6971
}
7072
}
7173
matches(...states) {

0 commit comments

Comments
 (0)