I am utilizing an Angular service that provides a filterObservable
.
To combine multiple calls, I am using Rx.Observable.zip()
.
Although it functions as expected, my TypeScript compiler is throwing an error for the method:
error TS2346: Supplied parameters do not match any signature of call target.
Could you please provide insight on what might be incorrect and how to fix this error?
protected getCombinedResults(ids:number[]) {
let observablesToGetZipped = ids.map(id => this.myService.loadResource(id));
if (observablesToGetZipped.length > 1) {
return Rx.Observable
.zip(observablesToGetZipped)
.take(1);
}
return observablesToGetZipped[0].take(1);
}
The method is being called like this:
this.getCombinedResults([1,2,3,4,5]).subscribe(result => { ... });