Skip to content

product

product<E, A, B>(first, second): TaskValidation<E, readonly [A, B]>

Defined in: Core/TaskValidation.ts:174

Runs two TaskValidations concurrently and combines their results into a tuple. If both are Valid, returns Valid with both values. If either fails, accumulates errors from both sides.

E

A

B

TaskValidation<E, A>

TaskValidation<E, B>

TaskValidation<E, readonly [A, B]>

await TaskValidation.product(
  validateName(form.name),
  validateAge(form.age),
)(); // Valid(["Alice", 30]) or Invalid([...errors])