From 45a742f97658dadc66917b5bd4f3b117eb506de7 Mon Sep 17 00:00:00 2001 From: Atik Shaikh <721.atikshaikh@gmail.com> Date: Fri, 9 Feb 2024 16:37:11 +0530 Subject: [PATCH 1/2] Reframed the "Observing cache behaviour" example point no.4 --- docs/rtk-query/usage/queries.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/rtk-query/usage/queries.mdx b/docs/rtk-query/usage/queries.mdx index b0568e3047..351a7800af 100644 --- a/docs/rtk-query/usage/queries.mdx +++ b/docs/rtk-query/usage/queries.mdx @@ -358,7 +358,7 @@ This example demonstrates request deduplication and caching behavior: 2. A second later, another `Pokemon` component is rendered with 'bulbasaur' - Notice that this one doesn't ever show 'Loading...' and no new network request happens? It's using the cache here. 3. A moment after that, a `Pokemon` component for 'pikachu' is added, and a new request happens. -4. When you click 'Refetch' of a particular pokemon type, it'll update all of them with one request. +4. When you click 'Refetch' for a specific `Pokemon`, it'll update only that pokemon with one request. :::note Try it out Click the 'Add bulbasaur' button. You'll observe the same behavior described above until you click the 'Refetch' button on one of the components. From 680c398d018153b16d2b86cfd142458beb4b8bee Mon Sep 17 00:00:00 2001 From: Atik Shaikh <149864892+721-atikshaikh@users.noreply.github.com> Date: Fri, 9 Feb 2024 17:05:04 +0530 Subject: [PATCH 2/2] Added more information --- docs/rtk-query/usage/queries.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/rtk-query/usage/queries.mdx b/docs/rtk-query/usage/queries.mdx index 351a7800af..eda4549328 100644 --- a/docs/rtk-query/usage/queries.mdx +++ b/docs/rtk-query/usage/queries.mdx @@ -358,7 +358,7 @@ This example demonstrates request deduplication and caching behavior: 2. A second later, another `Pokemon` component is rendered with 'bulbasaur' - Notice that this one doesn't ever show 'Loading...' and no new network request happens? It's using the cache here. 3. A moment after that, a `Pokemon` component for 'pikachu' is added, and a new request happens. -4. When you click 'Refetch' for a specific `Pokemon`, it'll update only that pokemon with one request. +4. When you click 'Refetch' for a specific `Pokemon`, it'll update all instances of that `Pokemon` with one request. :::note Try it out Click the 'Add bulbasaur' button. You'll observe the same behavior described above until you click the 'Refetch' button on one of the components.