File tree Expand file tree Collapse file tree 2 files changed +26
-6
lines changed Expand file tree Collapse file tree 2 files changed +26
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " mobx-tanstack-query " : minor
3+ ---
4+
5+ ` cancel() ` method for ` Query ` (-> ` queryClient.cancelQueries ` )
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ import {
1010 QueryObserverBaseResult ,
1111 FetchStatus ,
1212 QueryStatus ,
13+ CancelOptions ,
14+ ResetOptions ,
1315} from '@tanstack/query-core' ;
1416import { LinkedAbortController } from 'linked-abort-controller' ;
1517import {
@@ -575,12 +577,25 @@ export class Query<
575577 }
576578 }
577579
578- async reset ( params ?: QueryResetParams ) {
579- return await this . queryClient . resetQueries ( {
580- queryKey : this . options . queryKey ,
581- exact : true ,
582- ...params ,
583- } as any ) ;
580+ async reset ( params ?: QueryResetParams , options ?: ResetOptions ) {
581+ return await this . queryClient . resetQueries (
582+ {
583+ queryKey : this . options . queryKey ,
584+ exact : true ,
585+ ...params ,
586+ } ,
587+ options ,
588+ ) ;
589+ }
590+
591+ async cancel ( options ?: CancelOptions ) {
592+ return await this . queryClient . cancelQueries (
593+ {
594+ queryKey : this . options . queryKey ,
595+ exact : true ,
596+ } ,
597+ options ,
598+ ) ;
584599 }
585600
586601 async invalidate ( params ?: QueryInvalidateParams ) {
You can’t perform that action at this time.
0 commit comments