Course lesson
Refactor baseQuery to use RTK Query fetchBaseQuery
There are a lot of edge cases that our simple fetch code is not handling. RTK Query has a great utility function called fetchBaseQuery that will execute a fetch and handle those annoying edge cases that you don't need to think through. We will refactor to use...
- Duration
- 2 min
- Access
- Free
- Transcript
- Retained from source evidence
There are a lot of edge cases that our simple fetch code is not handling. RTK Query has a great utility function called fetchBaseQuery that will execute a fetch and handle those annoying edge cases that you don't need to think through.
We will refactor to use fetchBaseQuery with a "base url" and explore some new options like params and method we get as a result.