Closed chrisspiegl closed 7 months ago
Docs mentions that we can also return null as a reference and use it in the useDatabaseObject.
null
useDatabaseObject
https://github.com/vuejs/vuefire/blob/c4deaee2166aba5180ba4437a13401ec5e4a3c24/docs/guide/realtime-data.md?plain=1#L98
However, there is a warning in my code that this is not compatible.
Typescript warning as seen on the screenshot.
Additionally: it appears that the null value actually does work. So, I think it's just a type error that needs changing?
This is how the useDocument is typed:
useDocument
https://github.com/vuejs/vuefire/blob/c4deaee2166aba5180ba4437a13401ec5e4a3c24/src/firestore/index.ts#L87
This is how the useDatabaseObject is typed:
https://github.com/vuejs/vuefire/blob/c4deaee2166aba5180ba4437a13401ec5e4a3c24/src/database/index.ts#L57
Feel free to give this a go if you want!
Expected behavior
Docs mentions that we can also return
null
as a reference and use it in theuseDatabaseObject
.https://github.com/vuejs/vuefire/blob/c4deaee2166aba5180ba4437a13401ec5e4a3c24/docs/guide/realtime-data.md?plain=1#L98
However, there is a warning in my code that this is not compatible.
Actual behavior
Typescript warning as seen on the screenshot.
Additionally: it appears that the
null
value actually does work. So, I think it's just a type error that needs changing?Additional information
This is how the
useDocument
is typed:https://github.com/vuejs/vuefire/blob/c4deaee2166aba5180ba4437a13401ec5e4a3c24/src/firestore/index.ts#L87
This is how the
useDatabaseObject
is typed:https://github.com/vuejs/vuefire/blob/c4deaee2166aba5180ba4437a13401ec5e4a3c24/src/database/index.ts#L57