@ryandur/sand
    Preparing search index...

    Function asyncTryCatch

    • asyncTryCatch(() => navigator.clipboard.writeText(text), toError)
      .onFailure(explain); // guards the synchronous throw AND the rejection

      Type Parameters

      • VALUE
      • ERROR

      Parameters

      • fn: () => Promise<VALUE>
      • onError: (thrown: unknown) => ERROR

      Returns Result.Async<VALUE, ERROR>