Skip to content

Instantly share code, notes, and snippets.

@ThomasKruegl
Created January 13, 2021 18:27
Show Gist options
  • Save ThomasKruegl/0c27985e2bb14607095dcf8de689e96e to your computer and use it in GitHub Desktop.
Save ThomasKruegl/0c27985e2bb14607095dcf8de689e96e to your computer and use it in GitHub Desktop.
const { of, throwError } = Rx;
const { finalize, switchMap } = RxOperators;
const observable1 = of(1);
const observable2 = of(2);
const observableError = throwError("error");
function doStuff() {
console.log("stuff");
}
observableError
.pipe(
switchMap( () => observable2
.pipe(
finalize(() => doStuff())
)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment