Skip to content

Instantly share code, notes, and snippets.

@Ibro
Last active April 26, 2017 04:55
Show Gist options
  • Save Ibro/f6393a2bf0a8876558602875f10e005e to your computer and use it in GitHub Desktop.
Save Ibro/f6393a2bf0a8876558602875f10e005e to your computer and use it in GitHub Desktop.
Simple observer - Coding Blast - www.codingblast.com
import { Observable } from 'rxjs';
let words = ['coding blast', 'coding', 'blast'];
let source = Observable.from(words);
function next(value: string) {
console.log('next: ', value);
}
function error(err: any) {
console.log('error: ', err);
}
function complete() {
console.log('complete');
}
source.subscribe(next, error, complete);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment