Skip to content

Instantly share code, notes, and snippets.

@ashish173
Created November 24, 2016 15:13
Show Gist options
  • Save ashish173/2351cfa639fbbb508a3f91af06af3366 to your computer and use it in GitHub Desktop.
Save ashish173/2351cfa639fbbb508a3f91af06af3366 to your computer and use it in GitHub Desktop.
console.clear();
var source = Rx.Observable.create(observer => {
Rx.Observable.range(0,5).subscribe(
data => {
console.log(data)
if(data > 2) {
// conveys to the subscriber of source
// that values has changed
observer.next("greater than 2");
}
}
)
})
source.subscribe(
data => console.log(data)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment