Skip to content

_ready field in firestore plugin #60

Description

@Onurbon

Sometimes I want to distinguish three cases:

const data = db.things.get(id)
if (data._fetching) return <Spinner/>
if (data._notFound) return <NotFound/>
return <TheThing />

but sometimes I'm lazy and just want a spinner for two first cases, so it's be nice to just write

if (!data._ready) return <Spinner/>

were _ready === !_fetching && !_notFound

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions