In an older version of RxJs I used the following approach:
combineLatest([
this.state.select(selector1),
this.stage.select(selector2)
])
.pipe(...)
.subscribe(values => {
const parameter: any = values[0];
const data: any = values[1];
);
In my new project I'm using RxJs 7.5 and this is not possible anymore.
combineLatestWith([
this.userData.controls["name"].valueChanges,
this.userData.controls["lastName"].valueChanges,
this.userData.controls["age"].valueChanges,
this.userData.controls["birthDate"].valueChanges])
.subscribe((result:any) => {
);
The compiler says: "Property 'subscribe' does not exist on type 'OperatorFunction<unknown, [unknown, any]>'."
The following snipped looks kind of ugly:
this.userData.controls["name"].valueChanges.combineLatestWith([
this.userData.controls["lastName"].valueChanges,
this.userData.controls["age"].valueChanges,
this.userData.controls["birthDate"].valueChanges])
.subscribe((result: any) => {
console.log(result);
});
Is there another solution, similar to the first approach?