State Management · Senior · Question 11 of 75
What does combineSlices add to Redux Toolkit?
- ✓Correct answer: Lazy injection of slices, so code-split features add their reducers when loaded
- 2Merging two slices into one with combined action types
- 3Automatic persistence of slices to storage
Explanation
const rootReducer = combineSlices(authSlice) and later rootReducer.inject(lazySlice) from a lazily loaded module. Typed selectors (slice.selectors) handle the possibility that the slice isn't injected yet.