Skip to content

Instantly share code, notes, and snippets.

@cartant
Last active February 13, 2019 03:08
Show Gist options
  • Save cartant/7129a3670ba27768ae41362f661d0287 to your computer and use it in GitHub Desktop.
Save cartant/7129a3670ba27768ae41362f661d0287 to your computer and use it in GitHub Desktop.
import { interval, timer } from "rxjs";
import { shareReplay, takeUntil } from "rxjs/operators";
import { log } from "./log";
const source = log(interval(100), "source");
const shared = log(source.pipe(shareReplay(1)), "shared");
shared.pipe(
takeUntil(timer(150))
).subscribe(
value => console.log(`received: ${value}`)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment