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:
- Instead of
import 'rxjs/add/operator/combineLatest';
, useimport rxjs/rx
. This will register all operators (includingcombineLatest
) toObservable
. - 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'