Skip to content

Instantly share code, notes, and snippets.

@cartant
Last active May 26, 2018 08:11
Show Gist options
  • Select an option

  • Save cartant/0ae4f82daaf59b1d560b89f39c9caaa7 to your computer and use it in GitHub Desktop.

Select an option

Save cartant/0ae4f82daaf59b1d560b89f39c9caaa7 to your computer and use it in GitHub Desktop.
import { Observable } from "rxjs";
import { switchMap, takeUntil } from "rxjs/operators";
declare const a: Observable<number>;
declare const b: Observable<number>;
declare const notifier: Observable<any>;
const c = a.pipe(
takeUntil(notifier),
switchMap(_ => b)
).subscribe(value => console.log(value));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment