convex-js icon indicating copy to clipboard operation
convex-js copied to clipboard

Feature Request: Keep cached data around after unsubscribe is called

Open Tyler-Petrov opened this issue 3 months ago • 3 comments

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.

Tyler-Petrov avatar Aug 21 '25 22:08 Tyler-Petrov