State Management · Middle · Question 37 of 75

How does RTK Query avoid duplicate requests when 3 components call useGetUserQuery(1)?

Explanation

The cache key is endpoint + serialized argument. All subscribers share one request and one cache entry, which also stays alive while any of them is mounted.

Further reading

Problem with a question

State Management · Middle · question 37

Test yourself

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

Take this quiz