Angular - Auto Unsubscribe For Pros
Class decorator that will automatically unsubscribe from observable subscriptions when the component is destroyed
Installation
npm install ngx-auto-unsubscribe --save
Usage
; @@ one: Subscription; two: Subscription; {} { thisone = store
Options
Option | Description | Default Value |
---|---|---|
arrayName |
unsubscribe from subscriptions only in specified array | '' |
blackList |
an array of properties to exclude | [] |
event |
a name of event callback to execute on | ngOnDestroy |
Note: blackList
is ignored if arrayName
is specified.
Similar projects
You can also use https://github.com/NetanelBasal/ngx-take-until-destroy.