Open bemayr opened 3 years ago
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/mattpocock/xstate-catalogue/BoaNfJLf3FA6CzTEddPmgRySRpmG
✅ Preview: https://xstate-catalog-git-fork-bemayr-feature-reset-machine-mat-abcacc.vercel.app
I've got three [~two~] comments regarding the code:
props
and created using createMachine(...)
somewhere else. Any thoughts on this?@bemayr Good idea! This is for sure an important feature.
I'm not seeing it working on this link:
Will take a look at the code at some point, on my todo list
Thanks for your answer Matt and looking into this!
I'm not seeing it working on this link: https://xstate-catalog-git-fork-bemayr-feature-reset-machine-mat-abcacc.vercel.app/machines/form-input
What exactly is not working for you there? Because for me the button is there and it resets the machine...? 🤔
After working with the Catalogue quite a bit I encountered some situations where I wanted to reset the state machine. If I am the only one not being satisfied by hitting F5 in this case then please ignore and close this PR 😉!
During research on how to implement this I stumbled upon @mattpocock's comment regarding this on discord asking what is the best way to restart a service.
Implementing took a little while because of https://github.com/davidkpiano/xstate/issues/2084, which (1) has a workaround for now (that's the initial empty contexts) and (2) will be integrated in an upcoming version of @xstate/react.