convex-js
convex-js copied to clipboard
Feature Request: Keep cached data around after unsubscribe is called
https://github.com/get-convex/convex-js/blob/dcf514eecd46890c8bec9ee4e2b0c2cdd9c6b272/src/browser/simple_client.ts#L165-L170
When calling unsubscribe returned from onUpdate the query's cache is cleared right away.
https://github.com/get-convex/convex-js/blob/dcf514eecd46890c8bec9ee4e2b0c2cdd9c6b272/src/browser/sync/local_state.ts#L349-L383
It would be nice to be able to specify how long the cache should stay around. removeSubscriber deletes the cache (localQuery) right away if there are no subscribers.
Admittedly this is pretty niche, so it very well might not be worth it.