Skip to content

CollectionData() returning incorrect value first until it return expected data #105

@mzhfei

Description

@mzhfei

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions