@altitude/disposables
v2.0.2
Published
Manages resources such as RxJS subscriptions and observables, as well as custom disposable resources.
Downloads
21
Readme
alt-disposables
The Disposables
class offers a useful pattern for the consistent contextual management of multiple RxJS observables, subscriptions and custom disposable resources. All managed observables will be automatically cancelled when the dispose
method is invoked, all managed subscriptions unsubscribed from, and all custom resources disposed. This not only eliminates potentially difficult to debug memory leaks, but also ensures that no event handlers are invoked when they are no longer in context (for example, their host component is no longer in scope or has reached the end of its lifecycle).