Skip to content

Instantly share code, notes, and snippets.

@Ibro
Created April 26, 2017 06:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ibro/ec2a295776daefd4db9994a7bd4cbc9f to your computer and use it in GitHub Desktop.
Save Ibro/ec2a295776daefd4db9994a7bd4cbc9f to your computer and use it in GitHub Desktop.
RxJS - Cold observable - Two Subscribers - Coding Blast - www.codingblast.com
import {Observable} from 'rxjs';
let source = Observable
.interval(1000)
.take(6);
source.subscribe(x => console.log('sub 1: ', x));
setTimeout(function () {
source.subscribe(x => console.log(' sub 2: ', x));
}, 2700);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment