Skip to content

chainSecond

chainSecond<A, B, D>(f): (data) => These<A, D>

Defined in: Core/These.ts:181

Chains These computations by passing the second value to f. First propagates unchanged; Second and Both apply f to the second value.

A

B

D

(b) => These<A, D>

(data): These<A, D>

These<A, B>

These<A, D>

const shout = (s: string): These<number, string> => These.second(s.toUpperCase());

pipe(These.second("warn"), These.chainSecond(shout));      // Second("WARN")
pipe(These.both(5, "warn"), These.chainSecond(shout));     // Second("WARN")
pipe(These.first(5), These.chainSecond(shout));            // First(5)