Skip to content

Instantly share code, notes, and snippets.

@LironHazan
Created October 16, 2020 02:56
Show Gist options
  • Save LironHazan/a4a41ee729f924547a9bc709c18c7445 to your computer and use it in GitHub Desktop.
Save LironHazan/a4a41ee729f924547a9bc709c18c7445 to your computer and use it in GitHub Desktop.
Gal Falah's example for rxjs post
notNullish<T>(input: null | undefined | T): boolean {
return input !== null && input !== undefined;
}
registerToggleCall() {
Interactor.onTogglingSomthing()
.pipe(distinctUntilChanged(), filter(this.notNullish))
.subscribe((_state: boolean) => {
this.state = _state;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment