Share your code. Components are building blocks, you are the architect.

utils/pipe-k
v1.1.0
1.1.0
1.0.0
MIT
PUBLIC
3
Build: fail
BuildFail
Build Status: fail
Returns the left-to-right Kleisli composition of the provided functions,

Please configure Bit as a scoped registry to install components with NPM.Learn more

npm config set '@bit:registry' https://node.bitsrc.io
Use utils/pipe-k in your project
npm i @bit/bit.ramda.utils.pipe-k
Copied

pipeK (:...Function) : Function

Returns the left-to-right Kleisli composition of the provided functions, each of which must return a value of a type supported by chain.

R.pipeK(f, g, h) is equivalent to R.pipe(f, R.chain(g), R.chain(h)).

Example

//  parseJson :: String -> Maybe *
     //  get :: String -> Object -> Maybe *

     //  getStateCode :: Maybe String -> Maybe String
     var getStateCode = R.pipeK(
       parseJson,
       get('user'),
       get('address'),
       get('state'),
       R.compose(Maybe.of, R.toUpper)
     );

     getStateCode('{"user":{"address":{"state":"ny"}}}');
     //=> Just('NY')
     getStateCode('[Invalid JSON]');
     //=> Nothing()

Argument

...Function

Returns

Function