Automatically expose promises when using firestore option
See original GitHub issueIt would be useful to be able to use the short firestore notation and still be able to access the promises, for usage with vue-promised for instance.
There are not a lot of situation where data is loaded asynchronously, and a loader indicator is not necessary.
i.e.
<template>
<Promised :promise="$firestore.promised.todos">
<!-- etc... -->
</Promised>
<Promised :promise="$firestore.promised.currentTodo">
<!-- etc... -->
</Promised>
</template>
<script>
new Vue({
data: {
// Usually an array for collection
todos: [],
// and null for documents
currentTodo: null,
},
firestore: {
todos: db.collection('todos'),
currentTodo: db.collection('todos').doc('1'),
},
})
</script>
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Use the Cloud Firestore REST API - Firebase
The best way to begin experimenting with the REST API is to use the API Explorer, which automatically generates Google Identity OAuth 2.0...
Read more >How to use React Hooks with Firebase Firestore
In this article, we'll learn how to combine Firestore with React Hooks for a simple and efficient grocery list app.
Read more >Developing Real-Time Apps with Firebase and Firestore - Auth0
Learn how to develop a real-time web chat application with Firebase and Firestore with user registration and authentication secured with ...
Read more >re-base - Firebase Open Source
Bind a collection to a state property in your component. When then collection changes in firestore, your component will re-render with the latest...
Read more >Subscriptions in Apollo Server - Apollo GraphQL Docs
The second parameter is a filter function that returns true if a subscription update should be sent to a particular client, and false...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe that what we’re looking for is something parallel to the AngularFire $loaded event.
The computed method above works for me for now, but in future I’d like a single event to be fired when all vuefire promises have been resolved without the developer having to replicate all of the individual data variable names in a computed or created and maintain that list in two sections of the component.
I’d like to see this implemented as a vue lifecycle function that would get called when all vuefire calls have returned:
FYI this is now possible with the composables
useDocument()
and others