4 ms·
For me using xstate was a game changer. Pulling logic out into a state machine gives you so much clarity over your application logic. Also nice to have your bus
by johtso 4y ago
For me using xstate was a game changer. Pulling logic out into a state machine gives you so much clarity over your application logic. Also nice to have your business logic defined with something that is framework agnostic.
- nine_k 4y agoYes! An explicit state machine is my desire for the UI development since the Delphi days of 1990s. It makes things so much more observable and sane. Redux nudges you to build that state machine by hand, in the form of the reducers folder, around the centralized state. While elucidating, it's still a lot of boilerplate (which you can sort of factor out), and it's still not one clearly laid out entity.
- acemarke 4y agoFun fact: one of the XState devs did a proof-of-concept showing how to use XState state machines as Redux reducers and integrate the side effects handling as a middleware: https://github.com/mattpocock/redux-xstate-poc https://github.com/mattpocock/redux-xstate-poc We'd like to work together to turn that into a more official integration sometime soon.
- aarpmcgee 4y agoThis looks excellent. I see a lot of potential in the idea of combining the strengths of RTK(+Query) and XState. Thank you for sharing!
- acemarke 4y agoYeah, if you've got any particular use cases or ideas for how you'd like to use them, please put up a discussion thread in the RTK repo and let's talk!
- ramesh31 4y agoOnce you see the light of state machine based UI's, it's immediately obvious and you never want to go back. The problem comes in convincing others to deal with the boilerplate. It's worth it, but it never really sinks in until you use it.
- CitizenKane 4y agoI've had this same experience as well! Wrapping your head around the concepts at first can be a little tedious but it makes application logic and behavior far more predictable. The ability to visualize them is the icing on the cake as well and is a nice extra tool that eliminates the need for arrows and boxes in a sketchbook or a Google Drawing.