3 ms·
State management in Frontend really is a solved problem if you know what you’re doing. Use a tool like swr, react-query, or Apollo-client. I personally use gr
by zackify 5y ago
State management in Frontend really is a solved problem if you know what you’re doing.
Use a tool like swr, react-query, or Apollo-client.
I personally use graphql and my front end client manages most of the global state automatically.
Change a field, and it updates in other components.
Simple local state for modal transitions and other routine logic… and that’s all I need.
Every week there’s a new article bashing front end complexity with redux as the scape goat.
- yonixw 5y agoFlux and MobX are good if you don't want to fetch the server on every action or if you have a lot of cross references inside the data layer.
- alexjray 5y agoYou summed it up perfectly, react-query aims to literally solve this exact problem. It does it quite well I might add. React, Mobx etc are all reactive frameworks exactly for this reason. Given a set of data render x, update the render every time the data changes.
- mariusandra 5y agoAgreed that if your frontend is mostly GraphQL, and your data flow well taken care of, you shouldn't see a need for a separate state management solution. However sometimes you have to work with various APIs and filter/display/modify/update/delete/change/patch various parts of the responses you receive. That's the environment where solutions like Kea (mentioned in the blog post) come into their own.