Skip to content

Instantly share code, notes, and snippets.

@devmobasa
Last active April 26, 2017 04:55
Show Gist options
  • Select an option

  • Save devmobasa/d29443fe2b2d94740e773e88dc48d70a to your computer and use it in GitHub Desktop.

Select an option

Save devmobasa/d29443fe2b2d94740e773e88dc48d70a to your computer and use it in GitHub Desktop.
RxJS simple operators - Coding Blast - www.codingblast.com
import { Observable } from 'rxjs';
let numbers = [1, 2, 3];
let source = Observable
.from(numbers)
.map(n => n * 2)
.filter(n => n > 5);
source.subscribe(next, error, complete);
function next(value: number) {
console.log('next: ', value);
}
function error(err: any) {
console.log('error: ', err);
}
function complete() {
console.log('complete');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment