File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -208,8 +208,9 @@ const result = useQuery({
208208 - The failure count for the query.
209209 - Incremented every time the query fails.
210210 - Reset to ` 0 ` when the query succeeds.
211- - ` refetch : (options : { throwOnError: boolean }) => Promise < UseQueryResult> `
211+ - ` refetch : (options : { throwOnError: boolean, cancelRefetch : boolean }) => Promise < UseQueryResult> `
212212 - A function to manually refetch the query.
213213 - If the query errors, the error will only be logged. If you want an error to be thrown, pass the ` throwOnError: true ` option
214+ - If ` cancelRefetch` is ` true ` , then the current request will be cancelled before a new request is made
214215- ` remove : () => void `
215216 - A function to remove the query from the cache.
Original file line number Diff line number Diff line change @@ -216,7 +216,9 @@ export interface ResultOptions {
216216 throwOnError ?: boolean
217217}
218218
219- export interface RefetchOptions extends ResultOptions { }
219+ export interface RefetchOptions extends ResultOptions {
220+ cancelRefetch ?: boolean ;
221+ }
220222
221223export interface InvalidateQueryFilters extends QueryFilters {
222224 refetchActive ?: boolean
You can’t perform that action at this time.
0 commit comments