News for hackers. Stuff that matters.
Re:The new wave of React state management by code_biologist on Sunday July 03, 2022 @01:39AM (#31965375)
data is scoped globally by default, as opposed to per mount.

Uh, is the cache key the same? To me it is 100% clear that the cache key is used for a global cache, and that this is one of the core design principles of the library. This global cache management is exactly what I desire over useState without writing my own boilerplate.

Re:The new wave of React state management by lucasyvas on Sunday July 03, 2022 @10:06AM (#31967780)
I personally liked the library for its query and mutation APIs, but would have preferred caching be left out or opt-in.

I ended up having to do this myself by wrapping it all up and providing an option for the caller to opt-in to the underlying global key. If the option was not passed, it would append a unique ID to the base key by default so it would become scoped to the particular mount.

IMO that should be the default behaviour.