Skip to content

getFirstOrElse

getFirstOrElse<A>(defaultValue): <B>(data) => A

Defined in: Core/These.ts:248

Returns the first value, or a default if the These has no first value.

A

A

<B>(data): A

B

These<A, B>

A

pipe(These.first(5), These.getFirstOrElse(0));            // 5
pipe(These.both(5, "warn"), These.getFirstOrElse(0));     // 5
pipe(These.second("warn"), These.getFirstOrElse(0));      // 0