3 ms·
I think both are necessary in different circumstances. I use a simple litmus test: where does the state live to provide the best UX for my app if a user moves f
by code_biologist 3y ago
I think both are necessary in different circumstances. I use a simple litmus test: where does the state live to provide the best UX for my app if a user moves from their phone to a laptop and back again?
If the state needs to persist across devices it it server side (though a frontend cache can make sense), eg: onboarding flow or "task wizard" state.
Some UI interactions are much easier with state machines, but persisting state isn't a concern even across page refreshes, eg: complex animations or complex form validation states (especially validation that involves time or websockety things).