either
v0.9.6arrow_drop_downv0.9.6
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
3 KB
A function wrapping calls to the two functions in an `||` operation,
1 contributor
Like
Install either as a package?
Copied
npm i @bit/justin-capalbo.ramda.either
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
either (
f:
Function
,g:
) : Function
Function
A function wrapping calls to the two functions in an ||
operation,
returning the result of the first function if it is truth-y and the result
of the second function otherwise. Note that this is short-circuited,
meaning that the second function will not be invoked if the first returns a
truth-y value.
In addition to functions, R.either
also accepts any fantasy-land compatible
applicative functor.
Example
Arguments
f:
Function
a predicate
g:
Function
another predicate
Returns
Function
a function that applies its arguments to `f` and `g` and `||`s their outputs together.