Created
May 3, 2021 09:14
-
-
Save armanozak/a1b06e66a6943be7f62be040f11af80d to your computer and use it in GitHub Desktop.
[What's New in RxJS 7] RxJS 7 timeout #blog #rxjs
This file contains hidden or 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
import { timer } from "rxjs"; | |
import { timeout } from "rxjs/operators"; | |
const count$ = timer(3000, 2000); | |
count$ | |
.pipe(timeout({ first: 5000, each: 1000 })) | |
.subscribe({ next: console.log, error: console.error }); | |
// (after ~3s) 0 | |
// (after ~1s) Error: Timeout has occurred |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment