Share your code. Components are building blocks, you are the architect.

utils/any-pass
v1.1.0
1.1.0
MIT
PUBLIC
3
Build: fail
BuildFail
Build Status: fail
Takes a list of predicates and returns a predicate that returns true for a

Please configure Bit as a scoped registry to install components with NPM.Learn more

npm config set '@bit:registry' https://node.bitsrc.io
Use utils/any-pass in your project
npm i @bit/bit.ramda.utils.any-pass
Copied

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

var isClub = R.propEq('suit', '♣');
     var isSpade = R.propEq('suit', '♠');
     var 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