Can I use custom QueryCache with react-query?
Hi, I have an application where I buffer (cache) data into in-memory cache periodically. The cache structure is nested object which is optimized to read data efficiently. I have BufferManager class to manage writing and reading of cache and BufferClient to handle data fetching logic.
The app is similar to hls video player, but instead of buffering video frames, I buffer json objects in order to draw them on canvas.
Can I use my custom BufferManager as QueryCache so that I can use react-query to handle data fetching? For example, I want use useInfiniteQuery
My buffer (cache) structure looks like this:
2 Replies
generous-apricot•3y ago
you can try to create your own class that
extends QueryCache and then pass this into:
foreign-sapphireOP•3y ago
Thanks