Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (25 sloc) 766 Bytes

Creates Observable from multiple Observables.
Resulting stream will emit a combined value when all input streams emit a new value

const { rxObserver } = require('api/v0.3');
const { zip, timer, from } = require('rxjs');
const { take } = require('rxjs/operators');


const alphabet = 'abcdefghijklmnopqrstuvwxyz';
const alphabet$ = from(alphabet);

zip(
  timer(0, 5),
  alphabet$,
  (digit, letter)=>digit+letter // combinator
)
  .pipe(
    take(10)
  )
  .subscribe(rxObserver());
You can’t perform that action at this time.