Skip to content

Instantly share code, notes, and snippets.

@Ibro
Last active April 26, 2017 04:54
Show Gist options
  • Save Ibro/613c3340cfe0cd6ad953e6f921a02fe8 to your computer and use it in GitHub Desktop.
Save Ibro/613c3340cfe0cd6ad953e6f921a02fe8 to your computer and use it in GitHub Desktop.
Creating Observable error with throw - error method on observer - Coding Blast - www.codingblast.com
let source = Observable.create(observer => {
for (let word of words) {
if (word === 'badword') {
throw new Error('Bad word!');
}
observer.next(word);
}
observer.complete();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment