Skip to content

Instantly share code, notes, and snippets.

@ashish173
Created December 8, 2016 20:43
Show Gist options
  • Save ashish173/d0253ba925f466bdc7960874eb642cf3 to your computer and use it in GitHub Desktop.
Save ashish173/d0253ba925f466bdc7960874eb642cf3 to your computer and use it in GitHub Desktop.
Manual observable emit value
var source = Rx.Observable.create((observer) => {
setTimeout(() => {
console.log('timeout hit');
observer.onNext('Observable 101');
}, 1000);
console.log('observable initialized');
});
source.subscribe(x => console.log(x));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment