I am currently trying to call my Firebase Firestore - which works as expected when using the following code:
this.store.collection('posts').valueChanges().subscribe((data) => {
console.log(data);
});
Which is good and all but I'd much rather use async/await to get the data. I tried the following:
const test = await this.store.collection('posts').valueChanges().toPromise();
But test
is never populated when I place a debugger or console log of test
. Am I missing something stupid or can you not transform an Observable
to a promise and await it as above?