State Management · Middle · Question 56 of 75
How do you add RTK Query endpoints from a lazily loaded feature?
- ✓Correct answer: Call
api.injectEndpoints({ endpoints: ... })in the feature module - 2Create a second
createApiwith the samereducerPath - 3All endpoints must be defined in one file
Explanation
Injecting keeps one API slice and cache while splitting code by feature. The injected hooks are exported from the returned object.