Created
January 13, 2021 18:27
-
-
Save ThomasKruegl/0c27985e2bb14607095dcf8de689e96e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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