Course lesson
Refactor RTK Query Endpoints to use baseQuery to Remove Code Duplication
We can reduce code duplication using a baseQuery from RTK Query. We do this by moving duplicate code into a baseQuery function and writing query functions instead of queryFn. The return value of those query functions will be passed on as first argument into...
- Duration
- 1 min
- Access
- Free
- Transcript
- Retained from source evidence
We can reduce code duplication using a baseQuery from RTK Query. We do this by moving duplicate code into a baseQuery function and writing query functions instead of queryFn. The return value of those query functions will be passed on as first argument into the baseQuery.