Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



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.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: