Rezi
    Preparing search index...

    Function useAsync

    • Run an async operation when dependencies change.

      • Sets loading to true while the operation is in-flight
      • Stores resolved value in data
      • Stores thrown/rejected value in error
      • Ignores stale completions from older dependency runs

      Type Parameters

      • T

      Parameters

      • ctx: AsyncHookContext
      • task: () => Promise<T>
      • deps: readonly unknown[]

      Returns UseAsyncState<T>