Here's my observer that listens to a collection.
interface Scientist {
name?: string | null,
born?: number | null,
accomplishment?: string | null
};
export class AppComponent {
scientist$: Observable<Scientist[]>;
constructor(public firestore: Firestore) {
this.scientist$ = collectionData(collection(firestore, 'scientists'));
}
}
Works great but how do I detach the listener?