3 ms·
I keep state in a single object. State management is ridiculously simple but people tend to make it more challenging than it needs to be. I then send the data s
by austin-cheney 3y ago
I keep state in a single object. State management is ridiculously simple but people tend to make it more challenging than it needs to be. I then send the data stored in that object out of the browser as determined by the app for storage at the server. Restoring state is as simple as embedding the state data directly into the static html so that it’s always there as fast as possible every time the page is requested.
- solardev 3y agoSounds like using "window" as a big global variable, but cached on the backend almost like a manual cookie? Well typed, I'd imagine the dev ex would be similar to a monolithic React context. Seems like it'd work.