4 ms·
Nothing implicit about react query caching requests. That's the whole point of the library in the first place, otherwise it would just be a fetch wrapper. And
by gassiss 4y ago
Nothing implicit about react query caching requests. That's the whole point of the library in the first place, otherwise it would just be a fetch wrapper.
And having it behave differently from useState is fine, and correct. The library is used to fetch data, not state. Those are two different things
- lucasyvas 4y agoI disagree with the entire premise of the library then, because I consider a shared, global cache to introduce nothing but problems. I like its query and request primitives, but I don't like that they are coupled to the cache.
- erikpukinskis 4y agoIt’s purpose in my mind is to model server state, which is fundamentally global state. Are you using it for transient state? What are you using it for that’s meant to change between different parts of the app? It kind of sounds like your namespace needs to be broader, are you using a singleton where a collection is needed?