Skip to content

Commit eb04206

Browse files
committed
chore(types): fix changes
1 parent 7c21441 commit eb04206

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/database/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export interface UseDatabaseRefOptions extends _DatabaseRefOptions {}
4747
export function _useDatabaseRef(
4848
reference: _MaybeRef<_Nullable<DatabaseReference | Query>>,
4949
localOptions: UseDatabaseRefOptions = {}
50-
) {
50+
): _RefDatabase<unknown> {
5151
let unbind!: UnbindWithReset
5252
const options = Object.assign({}, databaseOptionsDefaults, localOptions)
5353
const initialSourceValue = unref(reference)
@@ -57,7 +57,7 @@ export function _useDatabaseRef(
5757
if (process.env.NODE_ENV !== 'production') {
5858
// is the target a ref that has already been passed to useDocument() and therefore can't be extended anymore
5959
if (options.target && checkWrittenTarget(data, 'useObject()/useList()')) {
60-
return data
60+
return data as _RefDatabase<unknown>
6161
}
6262
}
6363

src/firestore/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function _useFirestoreRef(
6969
>
7070
>,
7171
localOptions?: _UseFirestoreRefOptions
72-
) {
72+
): _RefFirestore<unknown> {
7373
let unbind: UnbindWithReset = noop
7474
const options = Object.assign({}, firestoreOptionsDefaults, localOptions)
7575
const initialSourceValue = unref(docOrCollectionRef)
@@ -82,7 +82,7 @@ export function _useFirestoreRef(
8282
options.target &&
8383
checkWrittenTarget(data, 'useDocument()/useCollection()')
8484
) {
85-
return data
85+
return data as _RefFirestore<unknown>
8686
}
8787
}
8888

tests/firestore/ssr.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('Firestore SSR', async () => {
4444
await promise.value
4545
return { data }
4646
},
47-
({ data }) => data.name
47+
({ data }) => data?.name
4848
)
4949

5050
expect(await renderToString(app)).toBe(`<p>a</p>`)
@@ -58,7 +58,7 @@ describe('Firestore SSR', async () => {
5858
const data = useDocument(docRef)
5959
return { data }
6060
},
61-
({ data }) => data.name
61+
({ data }) => data?.name
6262
)
6363

6464
expect(await renderToString(app)).toBe(`<p>hello</p>`)

0 commit comments

Comments
 (0)