Closed szulcus closed 1 year ago
It’s already possible with the promise: https://vuefire.vuejs.org/guide/realtime-data.html#subscription-state
@posva It is possible, but very unintuitive, as I wrote above 😕
@posva It is not documented anywhere that you need to destructure a promise from the collection and wait the promise.value
with useCollection anywhere in the doc.
I've had to dig deep into the type definition to understand.
I also tried
await useCollection(..., { wait: true, once: true, ssrKey: 'something' })
instead of
const {promise} = useCollection(..., { wait: true, once: true, ssrKey: 'something' })
await promise.value;
What problem is this solving
It would be great if the module supports await like
useAxios
fromVueUse
does: https://vueuse.org/integrations/useAxios/.Proposed solution
It would be easier to write:
than:
Describe alternatives you've considered
https://github.com/vueuse/vueuse/tree/main/packages/integrations/useAxios