Can't find `combineLatest` in RxJS 5.0

I think #1722 is the relevant GitHub issue here.

I'm on a project using [email protected], [email protected], and [email protected]. The following works for me:

import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/combineLatest';

Observable.combineLatest(
  source1,
  source2
).subscribe(sink);

To me this seems like a bug related to this issue.

Two potential workarounds:

  1. Instead of import 'rxjs/add/operator/combineLatest';, use import rxjs/rx. This will register all operators (including combineLatest) to Observable.
  2. Assign the imported function manually to the prototype:
    let Observable = require('rxjs/Observable.js').Observable;
    Observable.prototype.combineLatest = require('rxjs/add/operator/combineLatest');

I'm on RXJS 5.5.6, to import combineLatest for direct use (not as an operator) I had to use:

import {combineLatest} from 'rxjs/observable/combineLatest'

Tags:

Rxjs

Rxjs5