loading...

re: A simple explanation of functional pipe in JavaScript VIEW POST

FULL DISCUSSION
 

We can create another function to let pipe even more readable than pipeWith with the following function:

function pipeValue(args) {
    return {
        to: (...fns) => pipe(...fns)(args)
    }
}

const array = [1,2,3,4];
pipeValue(array).to(
    odds,
    double,
    log
);
 

This API really resonates with me. Thanks for sharing.

 

Or use the curried pipeline where you can pass your arguments directly.

 

Not a fan, this breaks functional composition

Code of Conduct Report abuse