Hello,
I came here after watching David's interesting video: https://www.youtube.com/watch?v=VU1NKX6Qkxc
I'm unclear about something and did not find a better place than here to ask.
The above mentioned presentation may lead one to believe XState is meant to help with managing the state of the whole app (Global state). Especially when David talks about graphs versus trees and how it's more natural to "touch" the state of a different component/node directly from another node instead of having to go up/down the "tree" (See video at precisely: https://www.youtube.com/watch?v=VU1NKX6Qkxc&feature=youtu.be&t=449 and about half a minute onward)
However, what I personally took out from that video is the idea that XState might help ease state management of a single component (Possible even a component and its children components) by using the DST "paradigm" and making state transition "explicit" and declarative.
Please someone explain if XState is meant for "App's global state management". Some example maybe... or explanation?
Thank you for any feedback.
Good question! I'll write a blog post about this, but in short:
You start small (think about the microinteractions) and then work up to describing the largest part of the app as a state machine (think URLs, workflows, etc.)
Thank you for your prompt reply David! Looking forward for the blog post.
You are suggesting to use XState for "managing" the whole app's state. Would you split that state into smaller chunks (a la Reflux's stores) or rather have conceptually one state "store" for the whole app (a la Redux).
Either way, I have a feeling things might get out of control even using Parallel and Nested state machines (given your app is relatively complex). Has anyone used XState in a moderately large front end application? Any good practices, gothas ...etc`?
Thanks again.
It's not meant for state management for the entire app; rather, it's meant to change the way you think about the finite states of your app and and work that in to how you're already managing your state.
XState is fairly new, so I assume developers are still kicking the tires before putting it in production apps!
Thanks again David.
Most helpful comment
Good question! I'll write a blog post about this, but in short:
You start small (think about the microinteractions) and then work up to describing the largest part of the app as a state machine (think URLs, workflows, etc.)