Skip to content

Instantly share code, notes, and snippets.

@juanmendes
Last active March 25, 2020 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juanmendes/430834f10a99bf4ef8a4f841dd1e0f25 to your computer and use it in GitHub Desktop.
Save juanmendes/430834f10a99bf4ef8a4f841dd1e0f25 to your computer and use it in GitHub Desktop.
A component that uses the SubscriptionTrackerMixin
@Component({})
class NonLeakyComponent extends SubscriptionTrackerMixin(Object) implements OnDestroy {
ngOnInit() {
const myTimer = timer(1,1);
this.subscribe(myTimer, () => console.log("timer called"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment