3 ms·
I’m wondering how this would work alongside the History API for web apps. SPAs have complicated flows, but is often good practice to use URLs for routing in cas
by h0l0cube 3y ago
I’m wondering how this would work alongside the History API for web apps. SPAs have complicated flows, but is often good practice to use URLs for routing in case the user hits refresh, restarts the browser, shares the link etc. As long as XState can be coaxed to keep the history sane, this could be a way to make web apps less buggy, with excellent visual documentation of the expected app behaviour to boot
- z3t4 3y agoYes, you can make your web app stateless by moving the state to the query string.
- h0l0cube 3y agoYes, and also the fragment. But what I’m referring to is that the state machine needs to manage burning the stack (e.g., clicking a ‘Done’ button on wizard would take you back several pages). When the user hits back they should be able to naturally affect the state machine and also to eventually leave the page to its referrer if they go back far enough