Skip to content

match

match<A, B, C>(cases): (data) => C

Defined in: Core/These.ts:227

Pattern matches on a These, returning the result of the matching case.

A

B

C

(a, b) => C

(a) => C

(b) => C

(data): C

These<A, B>

C

pipe(
  these,
  These.match({
    first: a => `First: ${a}`,
    second: b => `Second: ${b}`,
    both: (a, b) => `Both: ${a} / ${b}`
  })
);