mapFlow (property)

mapFlow: MapFlowInClassFn<T> = ...

Similar to Opt.map, but supports more functions which are called in succession, each on a result of a previous one.

Example

const sq = (x: number) => x * x;
const dec = (x: number) => x - 1;
opt(4).mapFlow(sq, dec) // Some(15)
opt(null).mapFlow(sq, dec) // None

See

mapFlow

Param


Back to index