Where is RxJS 6 static merge?

bingles picture bingles · Apr 27, 2018 · Viewed 16.2k times · Source

In RxJS 6, how do I import a static merge function for merging a list of Observables?

I want to be able to do:

const merged$ = merge(
    obs1$,
    obs2$,
    obs3$
);

I've tried:

import { merge } from 'rxjs/observable/merge'; and

import { merge } from 'rxjs/operators';

but neither seems to give me what I want.

Answer

siva636 picture siva636 · Apr 27, 2018

Importing has been made easy in RxJS 6:

 import { merge } from 'rxjs';

You may want to read the official migration guide.

Another useful resource regarding importing in RxJS 6 is this talk by Ben Lesh who is the RxJS lead.