4 ms·
Do you have any recommendations for resources/tools on state management? My background is in robotics engineering and I’m working on picking up front end so I c
by galoisscobi 4y ago
Do you have any recommendations for resources/tools on state management? My background is in robotics engineering and I’m working on picking up front end so I can build end to end web apps for myself. Currently learning react with a lot of head scratching.
- throwaway0asd 4y agoI 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.
- jrockway 4y agoIf you're building web apps for yourself, do you even need to do state management? Just print the results wrapped in HTML from your backend.
- galoisscobi 4y agoI’m hoping to grow side projects that I enjoy working on but not in the short term, hence current focus is to only build things for myself. It’s also fun and educational for me to develop my own toolbox to get a sense for what works at different scales, how to iterate quickly on features of arbitrary complexity in the same spirit as PG’s beating the averages essay.