-
Notifications
You must be signed in to change notification settings - Fork 305
No way to clean up Store instance that cancels pending requests #287
Comments
Hey this one is a bit tricky, I'm not opposed to it just not sure how to implement currently. Open to suggestions :-) |
Yeah, it is a bit tricky because of the
I think I'd personally lean more towards the first approach, feels a bit cleaner to me, and whether or not you even bother with letting the rx plugins wrap the cached single feels like something you could take or leave. I'm sure there's other ways to approach this as well that might be better, but that's what I came up with. Thoughts? |
Great ideas! Let me digest over the weekend. In theory I like 2's simplicity but maybe we can do in a defer fashion. alternatively we can change the inflight architecture in general. |
Do you have any update on this? |
If a store instance is no longer needed there's no way to tear it down without leaving any outstanding inflight requests running. Currently
clear()
invalidates inflight requests, but doesn't cancel the actual network request. Ideally there would be a way to destroy a store that also cancels those requests. Might be a little challenging to add because the rxcache()
operator that the store is currently using doesn't provide a way to dispose the underlying subscription and I'm not sure if there is an equivalent operator that does allow that.The text was updated successfully, but these errors were encountered: