Created
October 18, 2019 14:57
-
-
Save juanmendes/023583009e9061b2417a0b4495d673ae 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
@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