Skip to content

Instantly share code, notes, and snippets.

@Ibro
Created April 26, 2017 05:00
Show Gist options
  • Save Ibro/4c00925df5f2aadd508f400ad9cdb725 to your computer and use it in GitHub Desktop.
Save Ibro/4c00925df5f2aadd508f400ad9cdb725 to your computer and use it in GitHub Desktop.
Observable.of - creating Observable from arguments - Coding Blast - www.codingblast.com
import {Observable} from 'rxjs';
let source = Observable
.of('coding blast', 'badword', 'coding', 'blast')
.map(w => w + ' RxJS');
console.log('before subscribe');
source.subscribe(function next(value) {
console.log('Subscriber - next: ', value);
},
function error(err) {
console.log('Subscriber - error: ', err);
},
function complete() {
console.log('Subscriber - complete');
});
console.log('after subscribe');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment