The Best Practice on Data Fetching
Explore effective data fetching techniques in Redux applications using Redux Toolkit. Understand how createAsyncThunk simplifies async operations, supports request cancellation, and compare its advantages over older patterns like sagas. Learn when to consider alternative tools like react-query or RTK-query for managing frontend data.
We'll cover the following...
The modern Redux journey isn’t quite done yet!
Place 5 intermediate or senior frontend engineers in a room, and ask their opinion on the best way to fetch data in a growing frontend application. You’re likely going to end the meeting 3 hours later without reaching a conclusion.
Okay, maybe 3 hours is a little too much, but I won’t be surprised if that happens!
Data fetching is a core part of every decent web application, and there are several ways to go about it.
Redux apps don’t live isolated. In the context of a React application, they live within a React app! This forces you to not only think about “Redux” but take a more holistic approach by considering the entire frontend application.
Older Redux patterns
Middleware adaptations such as Redux-saga and Redux-observable was the best approach to manage the async operations of a growing web application.
I’m not ...