The maximum amount of arguments that combineLatest can take as input is 6.
More specifically, it takes as input one array that can have up to 6 elements. This way types are automatically inferred.
So if in the below code I add this.someMethodReturningObservable7() I break it:
someMethod(...) {
return combineLatest([
this.someMethodReturningObservable1(),
this.someMethodReturningObservable2(),
this.someMethodReturningObservable3(),
this.someMethodReturningObservable4(),
this.someMethodReturningObservable5(),
this.someMethodReturningObservable6(),
this.someMethodReturningObservable7(), // this causes problems
]).pipe(
map(([arg1, arg2, arg3, arg4, arg5, arg6, arg7]) => ({
arg1,
arg2,
arg3,
arg4,
arg5,
arg6,
arg7,
})),
// do more stuff
);
}
As long as I keep it to 6 arguments, it works fine. With more than 6 it doesn't.
How can I break this down into several combineLatest having maximum 6 arguments each?