Skip to content

bug(helpers): isEmpty returns false for collections with only deleted docs #486

Open
@matt-tingen

Description

@matt-tingen

Do you want to request a feature or report a bug?

Bug?

What is the current behavior?

isEmpty returns false for collections with only deleted docs e.g. { id1: null, id2: null }

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via codesandbox or similar.

Create a list component connected to firestore which changes its render when the collection is empty.
Delete all the docs from the collection.

What is the expected behavior?

isEmpty returns true for collections with only deleted docs.
To avoid making a breaking change and still allow for e.g. animating of the deletion of the last item in a collection, it may make more sense to either:

  1. More explicitly document the current behavior
  2. Include an additional helper which functions the same as isEmpty except when operating on collections with only deleted docs.

Which versions of dependencies, and which browser and OS are affected by this issue? Did this work in previous versions or setups?

react-redux-firebase 2.1.4
MacOS 10.13
Chrome 66

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions