pipe-k

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
3 KB
Returns the left-to-right Kleisli composition of the provided functions, each of which must return a value of a type supported by [`chain`](#chain).
1 contributor
Install pipe-k as a package?
Copied
npm i @bit/justin-capalbo.ramda.pipe-k
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
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
     const 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

Help and resources