any-pass

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
3 KB
Takes a list of predicates and returns a predicate that returns true for a
1 contributor
Install any-pass as a package?
Copied
npm i @bit/justin-capalbo.ramda.any-pass
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
anyPass (
predicates:Array
) : Function

Takes a list of predicates and returns a predicate that returns true for a given list of arguments if at least one of the provided predicates is satisfied by those arguments.

The function returned is a curried function whose arity matches that of the highest-arity predicate.

Example
const isClub = R.propEq('suit', '♣');
     const isSpade = R.propEq('suit', '♠');
     const isBlackCard = R.anyPass([isClub, isSpade]);

     isBlackCard({rank: '10', suit: '♣'}); //=> true
     isBlackCard({rank: 'Q', suit: '♠'}); //=> true
     isBlackCard({rank: 'Q', suit: '♦'}); //=> false
Argument
predicates: Array

An array of predicates to check

Returns
Function

The combined predicate

Help and resources