Oh Hello Apollo Client , Goodbye Redux!
Briefly

Oh Hello Apollo Client , Goodbye Redux!
"I know I got excited with the title there but it is kinda true 😅. In this blog post, I will cover why your switch to GQL and Apollo Client 3 should make you walk away from Redux. I will also talk about my journey from Redux -> Apollo Client. I have had my share of doubts so in the past couple of projects, I was really skeptical of using Apollo Client as a state management solution."
"Why I like Redux and what it is good at 💙 Global state management solution where you have a good visual of your entire state You use actions to trigger state updates and asynchronous requests (love 💌 my boo: 🔗) The entire ecosystem is amazing, you get Redux time travel too for debugging! ⏲ You can use libraries like Redux selectors (another awesome library 🔗) to select data from the state and transform"
Redux offers a global store, action-driven updates, a mature ecosystem, and debugging tools like time travel. Good state management requires normalized data, support for asynchronous actions, data transformation for simpler components and tests, and store visualization. React Hooks and Context with useReducer/useContext can replicate Redux patterns and reduce repetition. Apollo Client 3 supplies custom hooks (useQuery, useMutation) that automatically expose loading, success, and error states, removing the need for separate request/success/error actions. Apollo's cache and GraphQL data handling reduce boilerplate and enable replacing Redux in practical projects.
Read at Medium
Unable to calculate read time
[
|
]