Skip to content

How to get a list of changes that will be made in the result of an event? #1247

Answered by davidkpiano
kulesa asked this question in General
Discussion options

You must be logged in to vote

Easier than you think:

// Pure function; will not execute actions!
const nextState = machine.transition(currentState, event);

// Display this however you'd like
console.log(nextState.actions);

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kulesa
Comment options

Answer selected by davidkpiano
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants