Why does rxjs 6 combineLatest have type error when upgrading from rxjs 5?

1.5k Views Asked by At

I have the following code which compiled without errors in rxjs 5:

a$ = Observable.combineLatest([x$, y$])
  .subscribe(([x, y]:[X, Y]) => {

When I update to rxjs 6 the following error occurs:

Argument of type '([x, y]: [X, Y]) => void' is not assignable to parameter of type '(value: Y[]) => void'.
  Types of parameters '__0' and 'value' are incompatible.
Type 'Y[]' is not assignable to type '[X, Y]'.
  Property '0' is missing in type 'Y[]'.

Also, the error goes away if I change either type X or Y to the any type.

0

There are 0 best solutions below