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

utils/compose-k
v1.1.0
1.1.0
1.0.0
MIT
PUBLIC
3
Build: fail
BuildFail
Build Status: fail
Returns the right-to-left 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/compose-k in your project
npm i @bit/bit.ramda.utils.compose-k
Copied

composeK (null.null.null.functions:...Function) : Function

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

R.composeK(h, g, f) is equivalent to R.compose(R.chain(h), R.chain(g), f).

Example

//  get :: String -> Object -> Maybe *
      var get = R.curry((propName, obj) => Maybe(obj[propName]))

      //  getStateCode :: Maybe String -> Maybe String
      var getStateCode = R.composeK(
        R.compose(Maybe.of, R.toUpper),
        get('state'),
        get('address'),
        get('user'),
      );
      getStateCode({"user":{"address":{"state":"ny"}}}); //=> Maybe.Just("NY")
      getStateCode({}); //=> Maybe.Nothing()

Argument

null.null.null.functions: ...Function

The functions to compose

Returns

Function