Closed AndersCan closed 4 years ago
onEnter (and other functions with callbacks) look like this:
public onEnter(state: T, callback: (from?: T, event?: any) => ... {...}
From reading the code, I think it should be: callback: (from: T, event?: any) as callback is always called with either state or this.currentState. If the ? is correct I think the docs should mention this :)
callback: (from: T, event?: any)
state
this.currentState
?
Made a playground showing the issue.
Let me know if I should make a PR with these changes :)
Hi @AndersCan thanks for the issue!
You are right, the from argument should always be populated on transition.
from
Definitely would accept a PR to this effect :+1:
onEnter (and other functions with callbacks) look like this:
From reading the code, I think it should be:
callback: (from: T, event?: any)
as callback is always called with eitherstate
orthis.currentState
. If the?
is correct I think the docs should mention this :)Made a playground showing the issue.
Let me know if I should make a PR with these changes :)