Skip to content

Instantly share code, notes, and snippets.

@armanozak
Created May 3, 2021 09:15
Show Gist options
  • Save armanozak/2a8e6716549c2e07b17e01a6a0e02ecf to your computer and use it in GitHub Desktop.
Save armanozak/2a8e6716549c2e07b17e01a6a0e02ecf to your computer and use it in GitHub Desktop.
[What's New in RxJS 7] RxJS 7 timeout with #blog #rxjs
import { timer } from "rxjs";
import { timeout } from "rxjs/operators";
timer(5000, 1000)
.pipe(timeout({ first: 2000, with: _ => of("timeout") }))
.subscribe(console.log);
// (after ~2s) timeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment