I wrote the following code following RxJS 6 documentation. I'm currently running angular 5, RxJS 6 and angularfire2 rc.10. The error I get is
[ts] property 'pipe' does not exist on type 'OperatorFunction<{}, [{}, user, string]>'.
This is the code
this.companies$ = combineLatest(this.authService.user$, this.filter$).pipe(
switchMap(([user, filter]) =>
this.afs.collection("companies", ref => {
if (user) {
ref.where("owner.network", "==", user.activeNetworkProfile.id);
}
if (user) {
ref.where("name", "==", filter);
}
return ref;
}).valueChanges()
)
);
this.authService.user$ and this.filter$ are observables.
public filter$: Observable<string>;
public user$ : Observable<User>;
You haven't shown your import statements, but from the look of the error message, it seems you're importing the wrong combineLatest
function.
RxJS6 has two combineLatest
functions:
import {combineLatest} from 'rxjs/operators'
import { combineLatest } from 'rxjs'
You're using the creation method, so the import should from 'rxjs'
and not from 'rxjs/operators'
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With