Skip to content
Source
Sign inSign up
TanStack/query

fix(vue-query): update `initialData` type to allow `InitialDataFunction` and `NonUndefinedGuard`, similar to react-query #9073

Mergedsaul-atomrigs(GitHub profile, opens in a new tab)merged 5 commits intomain fromrefs/pull/9073/headmerged by DamianOsipiuk(GitHub profile, opens in a new tab) View on GitHub

Showing 3 changed files with 12 additions and 6 deletions.

x
0 of 3 viewed, 3 left
4 additions and 2 deletionspackages/vue-query/src/__tests__/useQueries.test-d.tsModified
View file
@@ -35,7 +35,7 @@
})
​
expectTypeOf(queriesState[0].data).toEqualTypeOf<{ wow: boolean }>()
- expectTypeOf(queriesState[1].data).toEqualTypeOf<string>()
+ expectTypeOf(queriesState[1].data).toEqualTypeOf<string | undefined>()
expectTypeOf(queriesState[2].data).toEqualTypeOf<string | undefined>()
})
​
@@ -54,7 +54,9 @@
​
const { value: queriesState } = useQueries({ queries: [options] })
​
- expectTypeOf(queriesState[0].data).toEqualTypeOf<{ wow: boolean }>()
+ expectTypeOf(queriesState[0].data).toEqualTypeOf<
+ { wow: boolean } | undefined
+ >()
})
​
it('should be possible to define a different TData than TQueryFnData using select with queryOptions spread into useQueries', () => {
3 additions and 3 deletionspackages/vue-query/src/__tests__/useQuery.test-d.tsModified
View file