Skip to content

product

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

Defined in: Core/TaskValidation.ts:183

Runs two TaskValidations concurrently and combines their results into a tuple. If both are Passed, returns Passed 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),
)(); // Passed(["Alice", 30]) or Failed([...errors])