Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export class Component {
- mounted = true;
- constructor(private s: MyService){}
- onMount(){
- this.s.obs.takeWhile(makePredicate()).subscribe(...)
- }
- makePredicate(){
- return () => this.mounted;
- }
- onDismount(){
- this.mounted = false;
- }
- }
Add Comment
Please, Sign In to add comment