Where is RxJS 6 static merge?

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.


I believe now when the "creation" classes were removed the recommended way is importing directly from 'rxjs':

import { merge as mergeStatic } from 'rxjs';

Previous alpha version of RxJS 6 used to have 'rxjs/create' file but this has been removed already: https://github.com/ReactiveX/rxjs/blob/master/CHANGELOG.md#600-alpha3-2018-02-06

However this expects you to use path maps correctly otherwise you'll import a lot of things you don't need. If you don't use path maps or the build process hidden from you you can import directly the correct file:

import { merge as mergeStatic } from 'rxjs/internal/observable/merge';

Tags:

Rxjs

Rxjs6