awaitAsync

Creates an await transformation action.

const Action = v.awaitAsync<TInput>();

Generics

  • TInput extends Promise<unknown>

Explanation

With awaitAsync you can transform a promise into its resolved value.

Returns

Examples

The following examples show how awaitAsync can be used.

Unique emails schema

Schema to check a set of emails wrapped in a promise object.

const UniqueEmailsSchema = v.pipeAsync(
  v.promise(),
  v.awaitAsync(),
  v.set(v.pipe(v.string(), v.email()))
);

The following APIs can be combined with awaitAsync.

Schemas

Utils

Async

Contributors

Thanks to all the contributors who helped make this page better!

  • GitHub profile picture of @fabian-hiller
  • GitHub profile picture of @EltonLobo07

Partners

Thanks to our partners who support the project ideally and financially.

Sponsors

Thanks to our GitHub sponsors who support the project financially.

  • GitHub profile picture of @antfu
  • GitHub profile picture of @Thanaen
  • GitHub profile picture of @osdiab
  • GitHub profile picture of @ruiaraujo012
  • GitHub profile picture of @hyunbinseo
  • GitHub profile picture of @F0rce
  • GitHub profile picture of @UniquePixels
  • GitHub profile picture of @jdgamble555
  • GitHub profile picture of @nickytonline
  • GitHub profile picture of @KubaJastrz
  • GitHub profile picture of @andrewmd5
  • GitHub profile picture of @caegdeveloper
  • GitHub profile picture of @dslatkin
  • GitHub profile picture of @BrianCurliss