Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_ready field in firestore plugin #60

Open
Onurbon opened this issue Sep 12, 2019 · 1 comment
Open

_ready field in firestore plugin #60

Onurbon opened this issue Sep 12, 2019 · 1 comment
Labels
enhancement ✨ New feature or request

Comments

@Onurbon
Copy link
Contributor

Onurbon commented Sep 12, 2019

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

@coffee-cup
Copy link
Collaborator

I can see the use of it, however, it might it easy for users to just handle not ready the same as fetching, which is not always the case. We might want to force users to handle the case where the data is not found or there was an error.

@coffee-cup coffee-cup added the enhancement ✨ New feature or request label Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants