question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

useSuspenseQuery using global cache

See original GitHub issue

Hi,

I have been using this library for data fetching in a Suspense-enabled React application I am building. However, it occurred to me that useSuspenseQuery does not use the cacheProvider given to the client, but instead uses a global cache.

https://github.com/marcin-piela/react-fetching-library/blob/ae87931f4693232a6d713b2cdd511f11d638e579/src/hooks/useSuspenseQuery/useSuspenseQuery.ts#L12

https://github.com/marcin-piela/react-fetching-library/blob/ae87931f4693232a6d713b2cdd511f11d638e579/src/hooks/useSuspenseQuery/useSuspenseQuery.ts#L17

Is there any reason why useSuspenseQuery uses a global cache instead of the cache from the client? In my case, I cannot share caches/clients between requests as to prevent sensitive information from leaking between requests.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
marcin-pielacommented, Jan 8, 2020

@fabianishere please check the new version

fell free to reopen that issue when needed

0reactions
fabianisherecommented, Jan 7, 2020

Great! Let me know if you need any help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

RFC: React 18 SSR + Suspense Support #10231 - GitHub
Using useSuspenseQuery will require use of a suspense cache to keep track of in-flight requests. This will be instantiated and passed to the...
Read more >
Seeding the Query Cache | TkDodo's blog
With suspense for data fetching on the horizon, it is now more important than ever to make sure your cache is seeded properly...
Read more >
Pre-Caching Images with React Suspense - CSS-Tricks
Suspense is an exciting, upcoming feature of React that will enable developers to easily allow their components to delay rendering until ...
Read more >
Configuring Query Caching - Oracle Help Center
You configure cache storage and other parameters in Fusion Middleware Control and in the NQSConfig.INI file, for both the query cache and the...
Read more >
Simple and powerful fetching library for react with HOOKS. No ...
Simple and powerful fetching library for react. Use hooks or HOCs to fetch data in easy way. No dependencies! Just react. Suspense support....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found