Skip to content

Instantly share code, notes, and snippets.

@Ibro
Created April 29, 2017 03:20
Show Gist options
  • Save Ibro/b99bb0ee19704b58956cc93b0e76bfcd to your computer and use it in GitHub Desktop.
Save Ibro/b99bb0ee19704b58956cc93b0e76bfcd to your computer and use it in GitHub Desktop.
RxJS - flatMap number into array - Coding Blast - www.codingblast.com
import {Observable} from 'rxjs';
let source = Observable
.interval(100) // interval starts from 0
.take(5) // take first 5
.flatMap(n => [n * 1, n * 2, n * 3]);
source.subscribe((value) => {
console.log('in next. Value: ', value);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment