@tanstack/solid-query 5.0.0-beta.17 → 5.0.0-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -227,7 +227,7 @@ describe('createQuery', () => {
227
227
 
228
228
  it('should return the correct states for a successful query', async () => {
229
229
  const key = queryKey()
230
- const states: CreateQueryResult<string>[] = []
230
+ const states: Array<CreateQueryResult<string>> = []
231
231
 
232
232
  function Page(): JSX.Element {
233
233
  const state = createQuery<string, Error>(() => ({
@@ -333,7 +333,7 @@ describe('createQuery', () => {
333
333
  it('should return the correct states for an unsuccessful query', async () => {
334
334
  const key = queryKey()
335
335
 
336
- const states: CreateQueryResult<unknown, Error>[] = []
336
+ const states: Array<CreateQueryResult<unknown, Error>> = []
337
337
 
338
338
  function Page() {
339
339
  const state = createQuery(() => ({
@@ -448,7 +448,7 @@ describe('createQuery', () => {
448
448
 
449
449
  it('should set isFetchedAfterMount to true after a query has been fetched', async () => {
450
450
  const key = queryKey()
451
- const states: CreateQueryResult<string>[] = []
451
+ const states: Array<CreateQueryResult<string>> = []
452
452
 
453
453
  await queryClient.prefetchQuery({
454
454
  queryKey: key,
@@ -605,7 +605,7 @@ describe('createQuery', () => {
605
605
 
606
606
  it('should be able to watch a query without providing a query function', async () => {
607
607
  const key = queryKey()
608
- const states: CreateQueryResult<string>[] = []
608
+ const states: Array<CreateQueryResult<string>> = []
609
609
 
610
610
  queryClient.setQueryDefaults(key, { queryFn: () => 'data' })
611
611
 
@@ -632,7 +632,7 @@ describe('createQuery', () => {
632
632
 
633
633
  it('should pick up a query when re-mounting with gcTime 0', async () => {
634
634
  const key = queryKey()
635
- const states: CreateQueryResult<string>[] = []
635
+ const states: Array<CreateQueryResult<string>> = []
636
636
 
637
637
  function Page() {
638
638
  const [toggle, setToggle] = createSignal(false)
@@ -712,7 +712,7 @@ describe('createQuery', () => {
712
712
 
713
713
  it('should fetch when refetchOnMount is false and nothing has been fetched yet', async () => {
714
714
  const key = queryKey()
715
- const states: CreateQueryResult<string>[] = []
715
+ const states: Array<CreateQueryResult<string>> = []
716
716
 
717
717
  function Page() {
718
718
  const state = createQuery(() => ({
@@ -741,7 +741,7 @@ describe('createQuery', () => {
741
741
 
742
742
  it('should not fetch when refetchOnMount is false and data has been fetched already', async () => {
743
743
  const key = queryKey()
744
- const states: CreateQueryResult<string>[] = []
744
+ const states: Array<CreateQueryResult<string>> = []
745
745
 
746
746
  queryClient.setQueryData(key, 'prefetched')
747
747
 
@@ -771,7 +771,7 @@ describe('createQuery', () => {
771
771
 
772
772
  it('should be able to select a part of the data with select', async () => {
773
773
  const key = queryKey()
774
- const states: CreateQueryResult<string>[] = []
774
+ const states: Array<CreateQueryResult<string>> = []
775
775
 
776
776
  function Page() {
777
777
  const state = createQuery(() => ({
@@ -800,7 +800,7 @@ describe('createQuery', () => {
800
800
 
801
801
  it('should be able to select a part of the data with select in object syntax', async () => {
802
802
  const key = queryKey()
803
- const states: CreateQueryResult<string>[] = []
803
+ const states: Array<CreateQueryResult<string>> = []
804
804
 
805
805
  function Page() {
806
806
  const state = createQuery(() => ({
@@ -829,7 +829,7 @@ describe('createQuery', () => {
829
829
 
830
830
  it('should be able to select a part of the data with select in object syntax', async () => {
831
831
  const key = queryKey()
832
- const states: CreateQueryResult<string>[] = []
832
+ const states: Array<CreateQueryResult<string>> = []
833
833
 
834
834
  function Page() {
835
835
  const state = createQuery(() => ({
@@ -858,7 +858,7 @@ describe('createQuery', () => {
858
858
 
859
859
  it('should not re-render when it should only re-render only data change and the selected data did not change', async () => {
860
860
  const key = queryKey()
861
- const states: CreateQueryResult<string>[] = []
861
+ const states: Array<CreateQueryResult<string>> = []
862
862
 
863
863
  function Page() {
864
864
  const state = createQuery(() => ({
@@ -898,7 +898,7 @@ describe('createQuery', () => {
898
898
 
899
899
  it('should throw an error when a selector throws', async () => {
900
900
  const key = queryKey()
901
- const states: CreateQueryResult<string>[] = []
901
+ const states: Array<CreateQueryResult<string>> = []
902
902
  const error = new Error('Select Error')
903
903
 
904
904
  function Page() {
@@ -931,7 +931,7 @@ describe('createQuery', () => {
931
931
 
932
932
  it('should track properties and only re-render when a tracked property changes', async () => {
933
933
  const key = queryKey()
934
- const states: CreateQueryResult<string>[] = []
934
+ const states: Array<CreateQueryResult<string>> = []
935
935
 
936
936
  function Page() {
937
937
  const state = createQuery(() => ({
@@ -979,7 +979,7 @@ describe('createQuery', () => {
979
979
  it('should always re-render if we are tracking props but not using any', async () => {
980
980
  const key = queryKey()
981
981
  let renderCount = 0
982
- const states: CreateQueryResult<string>[] = []
982
+ const states: Array<CreateQueryResult<string>> = []
983
983
 
984
984
  function Page() {
985
985
  const state = createQuery(() => ({
@@ -1032,7 +1032,7 @@ describe('createQuery', () => {
1032
1032
  { id: '2', done: true },
1033
1033
  ]
1034
1034
 
1035
- const states: CreateQueryResult<typeof result1>[] = []
1035
+ const states: Array<CreateQueryResult<typeof result1>> = []
1036
1036
 
1037
1037
  let count = 0
1038
1038
 
@@ -1091,7 +1091,7 @@ describe('createQuery', () => {
1091
1091
 
1092
1092
  it('should use query function from hook when the existing query does not have a query function', async () => {
1093
1093
  const key = queryKey()
1094
- const results: CreateQueryResult<string>[] = []
1094
+ const results: Array<CreateQueryResult<string>> = []
1095
1095
 
1096
1096
  queryClient.setQueryData(key, 'set')
1097
1097
 
@@ -1140,7 +1140,7 @@ describe('createQuery', () => {
1140
1140
 
1141
1141
  it('should update query stale state and refetch when invalidated with invalidateQueries', async () => {
1142
1142
  const key = queryKey()
1143
- const states: CreateQueryResult<number>[] = []
1143
+ const states: Array<CreateQueryResult<number>> = []
1144
1144
  let count = 0
1145
1145
 
1146
1146
  function Page() {
@@ -1214,7 +1214,7 @@ describe('createQuery', () => {
1214
1214
 
1215
1215
  it('should not update disabled query when refetched with refetchQueries', async () => {
1216
1216
  const key = queryKey()
1217
- const states: CreateQueryResult<number>[] = []
1217
+ const states: Array<CreateQueryResult<number>> = []
1218
1218
  let count = 0
1219
1219
 
1220
1220
  function Page() {
@@ -1260,7 +1260,7 @@ describe('createQuery', () => {
1260
1260
 
1261
1261
  it('should not refetch disabled query when invalidated with invalidateQueries', async () => {
1262
1262
  const key = queryKey()
1263
- const states: CreateQueryResult<number>[] = []
1263
+ const states: Array<CreateQueryResult<number>> = []
1264
1264
  let count = 0
1265
1265
 
1266
1266
  function Page() {
@@ -1306,7 +1306,7 @@ describe('createQuery', () => {
1306
1306
 
1307
1307
  it('should not fetch when switching to a disabled query', async () => {
1308
1308
  const key = queryKey()
1309
- const states: CreateQueryResult<number>[] = []
1309
+ const states: Array<CreateQueryResult<number>> = []
1310
1310
 
1311
1311
  function Page() {
1312
1312
  const [count, setCount] = createSignal(0)
@@ -1363,7 +1363,7 @@ describe('createQuery', () => {
1363
1363
 
1364
1364
  it('should keep the previous data when placeholderData is set', async () => {
1365
1365
  const key = queryKey()
1366
- const states: CreateQueryResult<number>[] = []
1366
+ const states: Array<CreateQueryResult<number>> = []
1367
1367
 
1368
1368
  function Page() {
1369
1369
  const [count, setCount] = createSignal(0)
@@ -1430,7 +1430,7 @@ describe('createQuery', () => {
1430
1430
 
1431
1431
  it('should not show initial data from next query if placeholderData is set', async () => {
1432
1432
  const key = queryKey()
1433
- const states: DefinedCreateQueryResult<number>[] = []
1433
+ const states: Array<DefinedCreateQueryResult<number>> = []
1434
1434
 
1435
1435
  function Page() {
1436
1436
  const [count, setCount] = createSignal(0)
@@ -1510,7 +1510,7 @@ describe('createQuery', () => {
1510
1510
 
1511
1511
  it('should keep the previous data on disabled query when placeholderData is set to identity function', async () => {
1512
1512
  const key = queryKey()
1513
- const states: CreateQueryResult<number>[] = []
1513
+ const states: Array<CreateQueryResult<number>> = []
1514
1514
 
1515
1515
  function Page() {
1516
1516
  const [count, setCount] = createSignal(0)
@@ -1602,7 +1602,7 @@ describe('createQuery', () => {
1602
1602
 
1603
1603
  it('should keep the previous data on disabled query when placeholderData is set and switching query key multiple times', async () => {
1604
1604
  const key = queryKey()
1605
- const states: CreateQueryResult<number>[] = []
1605
+ const states: Array<CreateQueryResult<number>> = []
1606
1606
 
1607
1607
  queryClient.setQueryData([key, 10], 10)
1608
1608
 
@@ -1684,7 +1684,7 @@ describe('createQuery', () => {
1684
1684
 
1685
1685
  it('should use the correct query function when components use different configurations', async () => {
1686
1686
  const key = queryKey()
1687
- const states: CreateQueryResult<number>[] = []
1687
+ const states: Array<CreateQueryResult<number>> = []
1688
1688
 
1689
1689
  function FirstComponent() {
1690
1690
  const state = createQuery(() => ({
@@ -1752,8 +1752,8 @@ describe('createQuery', () => {
1752
1752
 
1753
1753
  it('should be able to set different stale times for a query', async () => {
1754
1754
  const key = queryKey()
1755
- const states1: CreateQueryResult<string>[] = []
1756
- const states2: CreateQueryResult<string>[] = []
1755
+ const states1: Array<CreateQueryResult<string>> = []
1756
+ const states2: Array<CreateQueryResult<string>> = []
1757
1757
 
1758
1758
  await queryClient.prefetchQuery({
1759
1759
  queryKey: key,
@@ -1859,7 +1859,7 @@ describe('createQuery', () => {
1859
1859
 
1860
1860
  it('should re-render when a query becomes stale', async () => {
1861
1861
  const key = queryKey()
1862
- const states: CreateQueryResult<string>[] = []
1862
+ const states: Array<CreateQueryResult<string>> = []
1863
1863
 
1864
1864
  function Page() {
1865
1865
  const state = createQuery(() => ({
@@ -1889,7 +1889,7 @@ describe('createQuery', () => {
1889
1889
 
1890
1890
  it('should not re-render when it should only re-render on data changes and the data did not change', async () => {
1891
1891
  const key = queryKey()
1892
- const states: CreateQueryResult<string>[] = []
1892
+ const states: Array<CreateQueryResult<string>> = []
1893
1893
 
1894
1894
  function Page() {
1895
1895
  const state = createQuery(() => ({
@@ -2131,7 +2131,7 @@ describe('createQuery', () => {
2131
2131
 
2132
2132
  it('should not refetch query on focus when `enabled` is set to `false`', async () => {
2133
2133
  const key = queryKey()
2134
- const queryFn = vi.fn<unknown[], string>().mockReturnValue('data')
2134
+ const queryFn = vi.fn<Array<unknown>, string>().mockReturnValue('data')
2135
2135
 
2136
2136
  function Page() {
2137
2137
  const { data = 'default' } = createQuery(() => ({
@@ -2162,7 +2162,7 @@ describe('createQuery', () => {
2162
2162
 
2163
2163
  it('should not refetch stale query on focus when `refetchOnWindowFocus` is set to `false`', async () => {
2164
2164
  const key = queryKey()
2165
- const states: CreateQueryResult<number>[] = []
2165
+ const states: Array<CreateQueryResult<number>> = []
2166
2166
  let count = 0
2167
2167
 
2168
2168
  function Page() {
@@ -2197,7 +2197,7 @@ describe('createQuery', () => {
2197
2197
 
2198
2198
  it('should not refetch stale query on focus when `refetchOnWindowFocus` is set to a function that returns `false`', async () => {
2199
2199
  const key = queryKey()
2200
- const states: CreateQueryResult<number>[] = []
2200
+ const states: Array<CreateQueryResult<number>> = []
2201
2201
  let count = 0
2202
2202
 
2203
2203
  function Page() {
@@ -2232,7 +2232,7 @@ describe('createQuery', () => {
2232
2232
 
2233
2233
  it('should not refetch fresh query on focus when `refetchOnWindowFocus` is set to `true`', async () => {
2234
2234
  const key = queryKey()
2235
- const states: CreateQueryResult<number>[] = []
2235
+ const states: Array<CreateQueryResult<number>> = []
2236
2236
  let count = 0
2237
2237
 
2238
2238
  function Page() {
@@ -2267,7 +2267,7 @@ describe('createQuery', () => {
2267
2267
 
2268
2268
  it('should refetch fresh query on focus when `refetchOnWindowFocus` is set to `always`', async () => {
2269
2269
  const key = queryKey()
2270
- const states: CreateQueryResult<number>[] = []
2270
+ const states: Array<CreateQueryResult<number>> = []
2271
2271
  let count = 0
2272
2272
 
2273
2273
  function Page() {
@@ -2307,7 +2307,7 @@ describe('createQuery', () => {
2307
2307
 
2308
2308
  it('should calculate focus behaviour for refetchOnWindowFocus depending on function', async () => {
2309
2309
  const key = queryKey()
2310
- const states: CreateQueryResult<number>[] = []
2310
+ const states: Array<CreateQueryResult<number>> = []
2311
2311
  let count = 0
2312
2312
 
2313
2313
  function Page() {
@@ -2357,7 +2357,7 @@ describe('createQuery', () => {
2357
2357
 
2358
2358
  it('should refetch fresh query when refetchOnMount is set to always', async () => {
2359
2359
  const key = queryKey()
2360
- const states: CreateQueryResult<string>[] = []
2360
+ const states: Array<CreateQueryResult<string>> = []
2361
2361
 
2362
2362
  await queryClient.prefetchQuery({
2363
2363
  queryKey: key,
@@ -2400,7 +2400,7 @@ describe('createQuery', () => {
2400
2400
 
2401
2401
  it('should refetch stale query when refetchOnMount is set to true', async () => {
2402
2402
  const key = queryKey()
2403
- const states: CreateQueryResult<string>[] = []
2403
+ const states: Array<CreateQueryResult<string>> = []
2404
2404
 
2405
2405
  await queryClient.prefetchQuery({
2406
2406
  queryKey: key,
@@ -2731,7 +2731,7 @@ describe('createQuery', () => {
2731
2731
 
2732
2732
  it('should always fetch if refetchOnMount is set to always', async () => {
2733
2733
  const key = queryKey()
2734
- const states: CreateQueryResult<string>[] = []
2734
+ const states: Array<CreateQueryResult<string>> = []
2735
2735
 
2736
2736
  await queryClient.prefetchQuery({
2737
2737
  queryKey: key,
@@ -2785,7 +2785,7 @@ describe('createQuery', () => {
2785
2785
 
2786
2786
  it('should fetch if initial data is set', async () => {
2787
2787
  const key = queryKey()
2788
- const states: DefinedCreateQueryResult<string>[] = []
2788
+ const states: Array<DefinedCreateQueryResult<string>> = []
2789
2789
 
2790
2790
  function Page() {
2791
2791
  const state = createQuery(() => ({
@@ -2823,7 +2823,7 @@ describe('createQuery', () => {
2823
2823
 
2824
2824
  it('should not fetch if initial data is set with a stale time', async () => {
2825
2825
  const key = queryKey()
2826
- const states: DefinedCreateQueryResult<string>[] = []
2826
+ const states: Array<DefinedCreateQueryResult<string>> = []
2827
2827
 
2828
2828
  function Page() {
2829
2829
  const state = createQuery(() => ({
@@ -2861,7 +2861,7 @@ describe('createQuery', () => {
2861
2861
 
2862
2862
  it('should fetch if initial data updated at is older than stale time', async () => {
2863
2863
  const key = queryKey()
2864
- const states: DefinedCreateQueryResult<string>[] = []
2864
+ const states: Array<DefinedCreateQueryResult<string>> = []
2865
2865
 
2866
2866
  const oneSecondAgo = Date.now() - 1000
2867
2867
 
@@ -2907,7 +2907,7 @@ describe('createQuery', () => {
2907
2907
 
2908
2908
  it('should fetch if "initial data updated at" is exactly 0', async () => {
2909
2909
  const key = queryKey()
2910
- const states: DefinedCreateQueryResult<string>[] = []
2910
+ const states: Array<DefinedCreateQueryResult<string>> = []
2911
2911
 
2912
2912
  function Page() {
2913
2913
  const state = createQuery(() => ({
@@ -2946,7 +2946,8 @@ describe('createQuery', () => {
2946
2946
 
2947
2947
  it('should keep initial data when the query key changes', async () => {
2948
2948
  const key = queryKey()
2949
- const states: Partial<DefinedCreateQueryResult<{ count: number }>>[] = []
2949
+ const states: Array<Partial<DefinedCreateQueryResult<{ count: number }>>> =
2950
+ []
2950
2951
 
2951
2952
  function Page() {
2952
2953
  const [count, setCount] = createSignal(0)
@@ -2988,7 +2989,7 @@ describe('createQuery', () => {
2988
2989
  it('should retry specified number of times', async () => {
2989
2990
  const key = queryKey()
2990
2991
 
2991
- const queryFn = vi.fn<unknown[], unknown>()
2992
+ const queryFn = vi.fn<Array<unknown>, unknown>()
2992
2993
  queryFn.mockImplementation(() => {
2993
2994
  return Promise.reject(new Error('Error test Barrett'))
2994
2995
  })
@@ -3029,7 +3030,7 @@ describe('createQuery', () => {
3029
3030
  it('should not retry if retry function `false`', async () => {
3030
3031
  const key = queryKey()
3031
3032
 
3032
- const queryFn = vi.fn<unknown[], unknown>()
3033
+ const queryFn = vi.fn<Array<unknown>, unknown>()
3033
3034
 
3034
3035
  queryFn.mockImplementationOnce(() => {
3035
3036
  return Promise.reject(new Error('Error test Tanner'))
@@ -3077,7 +3078,7 @@ describe('createQuery', () => {
3077
3078
 
3078
3079
  type DelayError = { delay: number }
3079
3080
 
3080
- const queryFn = vi.fn<unknown[], unknown>()
3081
+ const queryFn = vi.fn<Array<unknown>, unknown>()
3081
3082
  queryFn.mockImplementation(() => {
3082
3083
  return Promise.reject({ delay: 50 })
3083
3084
  })
@@ -3179,7 +3180,7 @@ describe('createQuery', () => {
3179
3180
 
3180
3181
  it('should fetch on mount when a query was already created with setQueryData', async () => {
3181
3182
  const key = queryKey()
3182
- const states: CreateQueryResult<string>[] = []
3183
+ const states: Array<CreateQueryResult<string>> = []
3183
3184
 
3184
3185
  queryClient.setQueryData(key, 'prefetched')
3185
3186
 
@@ -3219,7 +3220,7 @@ describe('createQuery', () => {
3219
3220
 
3220
3221
  it('should refetch after focus regain', async () => {
3221
3222
  const key = queryKey()
3222
- const states: CreateQueryResult<string>[] = []
3223
+ const states: Array<CreateQueryResult<string>> = []
3223
3224
 
3224
3225
  // make page unfocused
3225
3226
  const visibilityMock = mockVisibilityState('hidden')
@@ -3286,12 +3287,12 @@ describe('createQuery', () => {
3286
3287
  // See https://github.com/tannerlinsley/react-query/issues/195
3287
3288
  it('should refetch if stale after a prefetch', async () => {
3288
3289
  const key = queryKey()
3289
- const states: CreateQueryResult<string>[] = []
3290
+ const states: Array<CreateQueryResult<string>> = []
3290
3291
 
3291
- const queryFn = vi.fn<unknown[], string>()
3292
+ const queryFn = vi.fn<Array<unknown>, string>()
3292
3293
  queryFn.mockImplementation(() => 'data')
3293
3294
 
3294
- const prefetchQueryFn = vi.fn<unknown[], string>()
3295
+ const prefetchQueryFn = vi.fn<Array<unknown>, string>()
3295
3296
  prefetchQueryFn.mockImplementation(() => 'not yet...')
3296
3297
 
3297
3298
  await queryClient.prefetchQuery({
@@ -3325,10 +3326,10 @@ describe('createQuery', () => {
3325
3326
  it('should not refetch if not stale after a prefetch', async () => {
3326
3327
  const key = queryKey()
3327
3328
 
3328
- const queryFn = vi.fn<unknown[], string>()
3329
+ const queryFn = vi.fn<Array<unknown>, string>()
3329
3330
  queryFn.mockImplementation(() => 'data')
3330
3331
 
3331
- const prefetchQueryFn = vi.fn<unknown[], Promise<string>>()
3332
+ const prefetchQueryFn = vi.fn<Array<unknown>, Promise<string>>()
3332
3333
  prefetchQueryFn.mockImplementation(async () => {
3333
3334
  await sleep(10)
3334
3335
  return 'not yet...'
@@ -3494,7 +3495,7 @@ describe('createQuery', () => {
3494
3495
 
3495
3496
  it('should mark query as fetching, when using initialData', async () => {
3496
3497
  const key = queryKey()
3497
- const results: DefinedCreateQueryResult<string>[] = []
3498
+ const results: Array<DefinedCreateQueryResult<string>> = []
3498
3499
 
3499
3500
  function Page() {
3500
3501
  const result = createQuery(() => ({
@@ -3529,7 +3530,7 @@ describe('createQuery', () => {
3529
3530
 
3530
3531
  it('should initialize state properly, when initialData is falsy', async () => {
3531
3532
  const key = queryKey()
3532
- const results: DefinedCreateQueryResult<number>[] = []
3533
+ const results: Array<DefinedCreateQueryResult<number>> = []
3533
3534
 
3534
3535
  function Page() {
3535
3536
  const result = createQuery(() => ({
@@ -3561,7 +3562,7 @@ describe('createQuery', () => {
3561
3562
  // // See https://github.com/tannerlinsley/react-query/issues/214
3562
3563
  it('data should persist when enabled is changed to false', async () => {
3563
3564
  const key = queryKey()
3564
- const results: DefinedCreateQueryResult<string>[] = []
3565
+ const results: Array<DefinedCreateQueryResult<string>> = []
3565
3566
 
3566
3567
  function Page() {
3567
3568
  const [shouldFetch, setShouldFetch] = createSignal(true)
@@ -3601,7 +3602,7 @@ describe('createQuery', () => {
3601
3602
 
3602
3603
  it('it should support enabled:false in query object syntax', async () => {
3603
3604
  const key = queryKey()
3604
- const queryFn = vi.fn<unknown[], string>()
3605
+ const queryFn = vi.fn<Array<unknown>, string>()
3605
3606
  queryFn.mockImplementation(() => 'data')
3606
3607
 
3607
3608
  function Page() {
@@ -3711,7 +3712,7 @@ describe('createQuery', () => {
3711
3712
 
3712
3713
  it('should not cause memo churn when data does not change', async () => {
3713
3714
  const key = queryKey()
3714
- const queryFn = vi.fn<unknown[], string>().mockReturnValue('data')
3715
+ const queryFn = vi.fn<Array<unknown>, string>().mockReturnValue('data')
3715
3716
  const memoFn = vi.fn()
3716
3717
 
3717
3718
  function Page() {
@@ -3794,7 +3795,7 @@ describe('createQuery', () => {
3794
3795
  it('should refetch in an interval depending on function result', async () => {
3795
3796
  const key = queryKey()
3796
3797
  let count = 0
3797
- const states: CreateQueryResult<number>[] = []
3798
+ const states: Array<CreateQueryResult<number>> = []
3798
3799
 
3799
3800
  function Page() {
3800
3801
  const state = createQuery(() => ({
@@ -3866,7 +3867,7 @@ describe('createQuery', () => {
3866
3867
 
3867
3868
  it('should not interval fetch with a refetchInterval of 0', async () => {
3868
3869
  const key = queryKey()
3869
- const states: CreateQueryResult<number>[] = []
3870
+ const states: Array<CreateQueryResult<number>> = []
3870
3871
 
3871
3872
  function Page() {
3872
3873
  const state = createQuery(() => ({
@@ -3947,7 +3948,7 @@ describe('createQuery', () => {
3947
3948
  it('should refetch if any query instance becomes enabled', async () => {
3948
3949
  const key = queryKey()
3949
3950
 
3950
- const queryFn = vi.fn<unknown[], string>().mockReturnValue('data')
3951
+ const queryFn = vi.fn<Array<unknown>, string>().mockReturnValue('data')
3951
3952
 
3952
3953
  function Disabled() {
3953
3954
  createQuery(() => ({ queryKey: key, queryFn, enabled: false }))
@@ -3984,7 +3985,7 @@ describe('createQuery', () => {
3984
3985
  it('should use placeholder data while the query loads', async () => {
3985
3986
  const key1 = queryKey()
3986
3987
 
3987
- const states: CreateQueryResult<string>[] = []
3988
+ const states: Array<CreateQueryResult<string>> = []
3988
3989
 
3989
3990
  function Page() {
3990
3991
  const state = createQuery(() => ({
@@ -4029,7 +4030,8 @@ describe('createQuery', () => {
4029
4030
  it('should use placeholder data even for disabled queries', async () => {
4030
4031
  const key1 = queryKey()
4031
4032
 
4032
- const states: { state: CreateQueryResult<string>; count: number }[] = []
4033
+ const states: Array<{ state: CreateQueryResult<string>; count: number }> =
4034
+ []
4033
4035
 
4034
4036
  function Page() {
4035
4037
  const [count, setCount] = createSignal(0)
@@ -4095,7 +4097,7 @@ describe('createQuery', () => {
4095
4097
  it('placeholder data should run through select', async () => {
4096
4098
  const key1 = queryKey()
4097
4099
 
4098
- const states: CreateQueryResult<string>[] = []
4100
+ const states: Array<CreateQueryResult<string>> = []
4099
4101
 
4100
4102
  function Page() {
4101
4103
  const state = createQuery(() => ({
@@ -4141,7 +4143,7 @@ describe('createQuery', () => {
4141
4143
  it('placeholder data function result should run through select', async () => {
4142
4144
  const key1 = queryKey()
4143
4145
 
4144
- const states: CreateQueryResult<string>[] = []
4146
+ const states: Array<CreateQueryResult<string>> = []
4145
4147
  let placeholderFunctionRunCount = 0
4146
4148
 
4147
4149
  function Page() {
@@ -4393,7 +4395,7 @@ describe('createQuery', () => {
4393
4395
 
4394
4396
  it('should cancel the query if the signal was consumed and there are no more subscriptions', async () => {
4395
4397
  const key = queryKey()
4396
- const states: CreateQueryResult<string>[] = []
4398
+ const states: Array<CreateQueryResult<string>> = []
4397
4399
 
4398
4400
  const queryFn: QueryFunction<
4399
4401
  string,
@@ -4463,7 +4465,7 @@ describe('createQuery', () => {
4463
4465
 
4464
4466
  it('should refetch when quickly switching to a failed query', async () => {
4465
4467
  const key = queryKey()
4466
- const states: CreateQueryResult<string>[] = []
4468
+ const states: Array<CreateQueryResult<string>> = []
4467
4469
 
4468
4470
  const queryFn = async () => {
4469
4471
  await sleep(50)
@@ -4513,7 +4515,7 @@ describe('createQuery', () => {
4513
4515
 
4514
4516
  it('should update query state and refetch when reset with resetQueries', async () => {
4515
4517
  const key = queryKey()
4516
- const states: CreateQueryResult<number>[] = []
4518
+ const states: Array<CreateQueryResult<number>> = []
4517
4519
  let count = 0
4518
4520
 
4519
4521
  function Page() {
@@ -4587,7 +4589,7 @@ describe('createQuery', () => {
4587
4589
 
4588
4590
  it('should update query state and not refetch when resetting a disabled query with resetQueries', async () => {
4589
4591
  const key = queryKey()
4590
- const states: CreateQueryResult<number>[] = []
4592
+ const states: Array<CreateQueryResult<number>> = []
4591
4593
  let count = 0
4592
4594
 
4593
4595
  function Page() {
@@ -4705,7 +4707,7 @@ describe('createQuery', () => {
4705
4707
  })
4706
4708
 
4707
4709
  it('should refetch when changed enabled to true in error state', async () => {
4708
- const queryFn = vi.fn<unknown[], unknown>()
4710
+ const queryFn = vi.fn<Array<unknown>, unknown>()
4709
4711
  queryFn.mockImplementation(async () => {
4710
4712
  await sleep(10)
4711
4713
  return Promise.reject(new Error('Suspense Error Bingo'))
@@ -4900,7 +4902,7 @@ describe('createQuery', () => {
4900
4902
 
4901
4903
  it('should have no error in pending state when refetching after error occurred', async () => {
4902
4904
  const key = queryKey()
4903
- const states: CreateQueryResult<number>[] = []
4905
+ const states: Array<CreateQueryResult<number>> = []
4904
4906
  const error = new Error('oops')
4905
4907
 
4906
4908
  let count = 0
@@ -5759,7 +5761,7 @@ describe('createQuery', () => {
5759
5761
 
5760
5762
  it('it should have status=error on mount when a query has failed', async () => {
5761
5763
  const key = queryKey()
5762
- const states: CreateQueryResult<unknown>[] = []
5764
+ const states: Array<CreateQueryResult<unknown>> = []
5763
5765
  const error = new Error('oops')
5764
5766
 
5765
5767
  const queryFn = async (): Promise<unknown> => {
@@ -28,7 +28,7 @@ describe("useQuery's in Suspense mode", () => {
28
28
 
29
29
  it('should render the correct amount of times in Suspense mode', async () => {
30
30
  const key = queryKey()
31
- const states: CreateQueryResult<number>[] = []
31
+ const states: Array<CreateQueryResult<number>> = []
32
32
 
33
33
  let count = 0
34
34
  let renders = 0
@@ -84,7 +84,7 @@ describe("useQuery's in Suspense mode", () => {
84
84
 
85
85
  it('should return the correct states for a successful infinite query', async () => {
86
86
  const key = queryKey()
87
- const states: CreateInfiniteQueryResult<InfiniteData<number>>[] = []
87
+ const states: Array<CreateInfiniteQueryResult<InfiniteData<number>>> = []
88
88
 
89
89
  function Page() {
90
90
  const [multiplier, setMultiplier] = createSignal(1)
@@ -94,7 +94,7 @@ describe("useQuery's in Suspense mode", () => {
94
94
  await sleep(10)
95
95
  return Number(pageParam * multiplier())
96
96
  },
97
- defaultPageParam: 1,
97
+ initialPageParam: 1,
98
98
  suspense: true,
99
99
  getNextPageParam: (lastPage) => lastPage + 1,
100
100
  }))
@@ -143,7 +143,7 @@ describe("useQuery's in Suspense mode", () => {
143
143
  it('should not call the queryFn twice when used in Suspense mode', async () => {
144
144
  const key = queryKey()
145
145
 
146
- const queryFn = vi.fn<unknown[], string>()
146
+ const queryFn = vi.fn<Array<unknown>, string>()
147
147
  queryFn.mockImplementation(() => {
148
148
  sleep(10)
149
149
  return 'data'
@@ -663,7 +663,7 @@ describe("useQuery's in Suspense mode", () => {
663
663
  it('should not call the queryFn when not enabled', async () => {
664
664
  const key = queryKey()
665
665
 
666
- const queryFn = vi.fn<unknown[], Promise<string>>()
666
+ const queryFn = vi.fn<Array<unknown>, Promise<string>>()
667
667
  queryFn.mockImplementation(async () => {
668
668
  await sleep(10)
669
669
  return '23'
@@ -59,7 +59,7 @@ describe('useIsFetching', () => {
59
59
  const key1 = queryKey()
60
60
  const key2 = queryKey()
61
61
 
62
- const isFetchings: number[] = []
62
+ const isFetchings: Array<number> = []
63
63
 
64
64
  function IsFetching() {
65
65
  const isFetching = useIsFetching()
@@ -125,7 +125,7 @@ describe('useIsFetching', () => {
125
125
  const key1 = queryKey()
126
126
  const key2 = queryKey()
127
127
 
128
- const isFetchings: number[] = []
128
+ const isFetchings: Array<number> = []
129
129
 
130
130
  function One() {
131
131
  createQuery(() => ({