Applies a sequence of functions to a value, from left to right.
This utility enables function composition in a left-to-right manner. It supports up to 26 chained functions from A through Z.
A
Z
The initial input value type.
Intermediate and final function return types.
The initial input value.
Additional unary functions composing of the previous result.
The final result after applying all functions.
import { Result } from '@praha/byethrow';const result = Result.pipe( 2, x => x + 1, x => x * 3, x => `Result: ${x}`);// Result: 9 Copy
import { Result } from '@praha/byethrow';const result = Result.pipe( 2, x => x + 1, x => x * 3, x => `Result: ${x}`);// Result: 9
Applies a sequence of functions to a value, from left to right.
This utility enables function composition in a left-to-right manner. It supports up to 26 chained functions from
A
throughZ
.Type Param: A
The initial input value type.
Type Param: B-Z
Intermediate and final function return types.
Param: value
The initial input value.
Param: functions
Additional unary functions composing of the previous result.
Returns
The final result after applying all functions.
Example