filter

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
18
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
2 KB
Takes a predicate and a `Filterable`, and returns a new filterable of the
1 contributor
Install filter as a package?
Copied
npm i @bit/justin-capalbo.ramda.filter
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
filter (
pred:Function,
filterable:Array
) : Array

Takes a predicate and a Filterable, and returns a new filterable of the same type containing the members of the given filterable which satisfy the given predicate. Filterable objects include plain objects or any object that has a filter method such as Array.

Dispatches to the filter method of the second argument, if present.

Acts as a transducer if a transformer is given in list position.

Example
const isEven = n => n % 2 === 0;

     R.filter(isEven, [1, 2, 3, 4]); //=> [2, 4]

     R.filter(isEven, {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, d: 4}
Arguments
pred: Function
filterable: Array
Returns
Array

Filterable

Help and resources