@@ -22,11 +22,11 @@ import {
2222
2323import {
2424 InfiniteQueryConfig ,
25- InfiniteQueryDynamicOptions ,
2625 InfiniteQueryInvalidateParams ,
2726 InfiniteQueryOptions ,
2827 InfiniteQueryResetParams ,
29- InfiniteQueryUpdateOptions ,
28+ InfiniteQueryStartParams ,
29+ InfiniteQueryUpdateOptionsAllVariants ,
3030} from './inifinite-query.types' ;
3131import { AnyQueryClient , QueryClientHooks } from './query-client.types' ;
3232
@@ -203,14 +203,6 @@ export class InfiniteQuery<
203203 ) ;
204204 }
205205
206- private checkIsEnabled ( ) {
207- if ( this . isEnabledOnResultDemand && ! this . isResultRequsted ) {
208- return false ;
209- }
210-
211- return this . holdedEnabledOption ;
212- }
213-
214206 fetchNextPage ( options ?: FetchNextPageOptions | undefined ) {
215207 return this . queryObserver . fetchNextPage ( options ) ;
216208 }
@@ -220,10 +212,12 @@ export class InfiniteQuery<
220212 }
221213
222214 update (
223- optionsUpdate :
224- | Partial < InfiniteQueryOptions < TData , TError , TQueryKey , TPageParam > >
225- | InfiniteQueryUpdateOptions < TData , TError , TQueryKey , TPageParam >
226- | InfiniteQueryDynamicOptions < TData , TError , TQueryKey , TPageParam > ,
215+ optionsUpdate : InfiniteQueryUpdateOptionsAllVariants <
216+ TData ,
217+ TError ,
218+ TQueryKey ,
219+ TPageParam
220+ > ,
227221 ) {
228222 if ( this . abortController . signal . aborted ) {
229223 return ;
@@ -365,6 +359,15 @@ export class InfiniteQuery<
365359 ) ;
366360 }
367361
362+ async start ( {
363+ cancelRefetch,
364+ ...params
365+ } : InfiniteQueryStartParams < TData , TError , TQueryKey , TPageParam > = { } ) {
366+ this . update ( { ...params } ) ;
367+
368+ return await this . refetch ( { cancelRefetch } ) ;
369+ }
370+
368371 protected handleAbort = ( ) => {
369372 this . _observerSubscription ?.( ) ;
370373
0 commit comments