1 contributor
Like
Install cond as a package?
Copied
npm i @bit/justin-capalbo.ramda.cond
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example modifieddraft
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
and packages in Bit or NPM to the example. any of the 1 million componentstoggle layout
No preview available
chevron_left
chevron_right
cond (
pairs:
) : Array
Function
Returns a function, fn
, which encapsulates if/else, if/else, ...
logic.
R.cond
takes a list of [predicate, transformer] pairs. All of the arguments
to fn
are applied to each of the predicates in turn until one returns a
“truthy” value, at which point fn
returns the result of applying its
arguments to the corresponding transformer. If none of the predicates
matches, fn
returns undefined.
Example
Argument
pairs:
Array
A list of [predicate, transformer]
Returns
Function