When using collectionData(), it always returns the latest entry first, then returns the actual values on the second emit. Say we have the following expected data:
Entry-1 ---> latest
Entry-2
Entry-3
Entry-4
With the following code:
collectionData(query, opt).pipe(
tap(cs => {
console.log("firebase returns :", cs)
}),
);
We will get two logs:
-> [Entry-1]
-> [Entry-1, Entry-2, Entry-3, Entry-4]
Ideally, we would want only 1 emit with all the data so views don't break(like scroll bar resets due to length of array changes) Any ideas on why this is happening and if there is a way/option we can prevent the first single emit from happening?
When using collectionData(), it always returns the latest entry first, then returns the actual values on the second emit. Say we have the following expected data:
With the following code:
We will get two logs:
Ideally, we would want only 1 emit with all the data so views don't break(like scroll bar resets due to length of array changes) Any ideas on why this is happening and if there is a way/option we can prevent the first single emit from happening?