Skip to content

fold

fold<A, B, C>(onFirst, onSecond, onBoth): (data) => C

Defined in: Core/These.ts:201

Extracts a value from a These by providing handlers for all three cases.

A

B

C

(a) => C

(b) => C

(a, b) => C

(data): C

These<A, B>

C

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