Skip to content

Generalized wizard state restore / resumption #82

Answered by youmustfight
mahmoud asked this question in Q&A
Discussion options

You must be logged in to vote

There is @mahmoud ! You can see the TWizardSession type for details here. The XState machine's context has a specific schema TCreateMachineContext for tracking internal changes as the person goes through the form. This is what gets modified overtime, what you'll have access to in the methods below so you can persist to a db, and then what you can load back in. Under the hood it's being passed in the plain old XState createMachine method.

There are 2 vars and 3 methods on the <WizardRunner /> top level component you'll want to use in combination with backend endpoints to persist to a session (aka machine context with a schema) to the database:

  • sessionEnabled: true/false for whether we run…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@mahmoud
Comment options

@mahmoud
Comment options

@youmustfight
Comment options

@mahmoud
Comment options

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