Skip to content

Instantly share code, notes, and snippets.

@juanmendes
Created October 18, 2019 14:57
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/023583009e9061b2417a0b4495d673ae to your computer and use it in GitHub Desktop.
Save juanmendes/023583009e9061b2417a0b4495d673ae to your computer and use it in GitHub Desktop.
@Component({})
class NotLeakyComponent implements OnDestroy {
private subTracker: SubscriptionTracker;
ngOnInit() {
const myTimer = timer(1,1);
this.subTracker.subscribe(myTimer,
() => console.log("timer called")
);
}
// Just to satisfy the interface
ngOnDestroy() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment