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

utils/inner-join
v1.1.0
1.1.0
MIT
PUBLIC
3
Build: fail
BuildFail
Build Status: fail
Takes a predicate `pred`, a list `xs`, and a list `ys`, and returns a list

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/inner-join in your project
npm i @bit/bit.ramda.utils.inner-join
Copied

innerJoin (pred:Function, xs:Array, ys:Array) : Array

Takes a predicate pred, a list xs, and a list ys, and returns a list xs' comprising each of the elements of xs which is equal to one or more elements of ys according to pred.

pred must be a binary function expecting an element from each list.

xs, ys, and xs' are treated as sets, semantically, so ordering should not be significant, but since xs' is ordered the implementation guarantees that its values are in the same order as they appear in xs. Duplicates are not removed, so xs' may contain duplicates if xs contains duplicates.

Example

R.innerJoin(
       (record, id) => record.id === id,
       [{id: 824, name: 'Richie Furay'},
        {id: 956, name: 'Dewey Martin'},
        {id: 313, name: 'Bruce Palmer'},
        {id: 456, name: 'Stephen Stills'},
        {id: 177, name: 'Neil Young'}],
       [177, 456, 999]
     );
     //=> [{id: 456, name: 'Stephen Stills'}, {id: 177, name: 'Neil Young'}]

Arguments

pred: Function

xs: Array

ys: Array

Returns

Array