Skip to content

Commit e7789e9

Browse files
committed
docs: diffs between reload and refetch
1 parent 5562f9e commit e7789e9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/data-loaders/defineColadaLoader.ts

+7
Original file line numberDiff line numberDiff line change
@@ -578,12 +578,19 @@ export interface UseDataLoaderColadaResult<
578578
UseQueryReturn<TData, TError, TDataInitial>,
579579
'isPending' | 'status' | 'asyncStatus' | 'state'
580580
> {
581+
/**
582+
* Equivalent to `useQuery().refetch()`. Refetches the data no matter if its stale or not.
583+
* @see reload - It also calls `refetch()` but returns an empty promise
584+
*/
581585
refetch: (
582586
to?: RouteLocationNormalizedLoaded
583587
// TODO: we might need to add this in the future
584588
// ...coladaArgs: Parameters<UseQueryReturn<Data, any>['refresh']>
585589
) => ReturnType<UseQueryReturn<TData, TError, TDataInitial>['refetch']>
586590

591+
/**
592+
* Equivalent to `useQuery().refresh()`. Refetches the data **only** if it's stale.
593+
*/
587594
refresh: (
588595
to?: RouteLocationNormalizedLoaded
589596
) => ReturnType<UseQueryReturn<TData, TError, TDataInitial>['refetch']>

0 commit comments

Comments
 (0)