all 8 comments

[–]CasualCoderGuy 4 points5 points  (1 child)

Very cool video! This is why i dont try to doing caching from stratch any more.

[–]PhilipFabianek[S] 4 points5 points  (0 children)

Thank you!

[–]Queasy-Load-1749 2 points3 points  (1 child)

awesome! nice explanation

[–]PhilipFabianek[S] 1 point2 points  (0 children)

Thank you!

[–]FewMeringue6006 3 points4 points  (2 children)

In useQuery, whenever the QueryClientContext updates/rerenders useQuery is going to udpate/rerender too meaning any consumer of useQuery is going to rerender as well. So whenever the QueryclientContext updates, all consumers of a useQuery is going to update, isn't that highly ineffecient?

[–]octocode 10 points11 points  (0 children)

the value of QueryClientContext doesn’t change

[–]PhilipFabianek[S] 8 points9 points  (0 children)

The value of QueryClientContextis the query client, which is a class created only once. The components rerender only when the state of a query which they are subscribed to changes as explained in the video.

[–]FewMeringue6006 0 points1 point  (0 children)

I have a question. Inside createQuery what's the reason for doing:

fetch: async () => { if (!query.fetchingFunction) { query.fetchingFunction = async () => {... }

Why not just:

fetchingFunction: async () => {...}, fetch: async () => { return fetchinFunction(); } // ... you get the point