unless
v0.9.6arrow_drop_downv0.9.6
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
922 B
Tests the final argument by passing it to the given predicate function.
1 contributor
Like
Install unless as a package?
Copied
npm i @bit/justin-capalbo.ramda.unless
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
unless (
pred:
Function
,whenFalseFn:
Function
,x:
) : *
*
Tests the final argument by passing it to the given predicate function. If
the predicate is not satisfied, the function will return the result of
calling the whenFalseFn
function with the same argument. If the predicate
is satisfied, the argument is returned as is.
Example
Arguments
pred:
Function
A predicate function
whenFalseFn:
Function
A function to invoke when the pred
evaluates
to a falsy value.
x:
*
An object to test with the pred
function and
pass to whenFalseFn
if necessary.
Returns
*
Either `x` or the result of applying `x` to `whenFalseFn`.