4 ms·
I wrote a thorough examination of state management with a code example. That essay is small enough to fit on two printed pages. I cannot share things I have wri
by throwaway0asd 4y ago
I wrote a thorough examination of state management with a code example. That essay is small enough to fit on two printed pages. I cannot share things I have written without breaking the anonymity of this account.
Here is the summary:
* You need a storage location
* You need a defined data structure to store your state data. I recommend storing everything in a single logical storage object, because 1 is simple and simple is good.
* You will need to update and save your storage object at the needs of your application. I do it on each user interaction, because this is cheap.
* On page load you will need to access your storage object and apply it to the user facing event handlers that create your state artifacts that otherwise normally execute in response to user interactions.
That’s it. Consider the problem from the goal and work backwards to the solution.
- galoisscobi 4y agoThat’s helpful. Thank you for taking the time to summarize your essay and sharing it here.