News for hackers. Stuff that matters.
Re:The new wave of React state management by gassiss on Sunday July 03, 2022 @08:29AM (#31967200)
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

Re:The new wave of React state management by lucasyvas on Sunday July 03, 2022 @10:04AM (#31967775)
I 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.

Re:The new wave of React state management by erikpukinskis on Sunday July 03, 2022 @11:32AM (#31968459)
It’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?