Skip to content

Commit

Permalink
rename useAsync.invalidate arg 'fullRefresh' -> 'forceUpdate'
Browse files Browse the repository at this point in the history
  • Loading branch information
LankyMoose committed Jun 21, 2024
1 parent 2c7327d commit db6d9c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/lib/src/hooks/useAsync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type UseAsyncResult<T> = (
error: UseAsyncError
}
) & {
invalidate: (fullRefresh?: boolean) => void
invalidate: (forceUpdate?: boolean) => void
}

export class UseAsyncError extends Error {
Expand Down Expand Up @@ -78,9 +78,9 @@ export function useAsync<T>(
load()
}
if (!oldHook) {
hook.invalidate = (fullRefresh?: boolean) => {
hook.invalidate = (forceUpdate?: boolean) => {
load()
fullRefresh && update()
forceUpdate && update()
}
}
return {
Expand Down

0 comments on commit db6d9c2

Please sign in to comment.