Skip to content

Instantly share code, notes, and snippets.

@ngohungphuc
Created March 8, 2019 10:03
Show Gist options
  • Save ngohungphuc/8d12846d78ca0661382f056e3a21dcab to your computer and use it in GitHub Desktop.
Save ngohungphuc/8d12846d78ca0661382f056e3a21dcab to your computer and use it in GitHub Desktop.
public user$: IUser;
private userStoreSubscription: Subscription = new Subscription();
constructor(private store: Store<UserState>) {}
ngOnInit(): void {
this.userStoreSubscription = this.store.select(getUser).subscribe(res => {
this.user$ = res;
});
}
ngOnDestroy(): void {
this.disabledUndoButtonSubscription.unsubscribe();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment