State Management · Senior · Question 34 of 75

Can RTK Query and createSlice state coexist in one store?

Explanation

Slices can listen to endpoint actions (builder.addMatcher(api.endpoints.login.matchFulfilled, ...)) - e.g. to store a token after login - while server data stays in the RTK Query cache.

Further reading

Problem with a question

State Management · Senior · question 34

Test yourself

Take the State Management · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz