How can I create an observable that depends on the value of another observable? It seems simple, but I can't figure out how to do it.
user$: Observable<firebase.User>;
playlists$: FirebaseListObservable<any>;
constructor(db: AngularFireDatabase,
private afAuth: AngularFireAuth) {
this.user$ = afAuth.authState;
// encountering an error here
this.playlists$ = this.user$.flatMap(user => db.list(`/playlists/${user.uid}`));
}
The issue at hand is: 'Observable' cannot be assigned to type 'FirebaseListObservable'. The property `$ref` is missing in the 'Observable' type.