Skip to content

fold

fold<E, A, B>(onErr, onOk, onBoth): (data) => B

Defined in: Core/These.ts:176

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

E

A

B

(e) => B

(a) => B

(e, a) => B

(data): B

These<E, A>

B

pipe(
  these,
  These.fold(
    e => `Error: ${e}`,
    a => `Value: ${a}`,
    (e, a) => `Both: ${e} / ${a}`
  )
);