Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Ensure RxJS users don't create memory leaks
There is a bit of excitement in the RxJS community about Svelte. - It seems like the rest of Svelte "just works™" with RxJS! - **BUT** The danger is that unwary users will figure out how smooth this API is and accidentally create nasty memory leaks if the returned RxJS Subscriptions are not handled. Fortunately the required change is small. NOTE: I am not entirely sure how to test this change. The goal here is to make sure that whenever you would normally teardown your store subscriptions, it is also tearing down these RxJS-shaped subscriptions. This is most commonly something you want in a component scenario. Say you have a timer component in your app that you show and remove with an `{#if}` block, when the `{#if}` block hides the component, you'd want to tear down the underlying Observable that is "ticking". Related sveltejs#2549
- Loading branch information