Skip to content

_ready field in firestore plugin #60

@Onurbon

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

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