Created
April 2, 2018 21:26
-
-
Save briandilley/36f38b0c66dd8b30dc8123e656be1cf9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class BaseRxComponent | |
implements OnDestroy { | |
private subscription: Subscription = new Subscription(); | |
protected manage(teardown: TeardownLogic): Subscription { | |
return this.subscription.add(teardown); | |
} | |
protected unsubscribe(): void { | |
this.subscription.unsubscribe(); | |
this.subscription = new Subscription(); | |
} | |
public ngOnDestroy(): void { | |
this.unsubscribe(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment