@aegenet/belt-array-async-filter
v2.3.0
Published
Array async filter (sequentially)
Downloads
78
Readme
@aegenet/belt-array-async-filter
Array async filter (sequentially)
💾 Installation
yarn add @aegenet/belt-array-async-filter@^2.0.0
# or
npm i @aegenet/belt-array-async-filter@^2.0.0
📝 Usage
import { arrayAsyncFilter } from '@aegenet/belt-array-async-filter';
const result = await arrayAsyncFilter(
[
{
id: 5,
value: 'Yo',
}, {
id: 7,
value: 'Ho',
}
],
(value, idx, array) => /** a promise */ Promise.resolve(idx === 0)
);
// result = [
// {
// id: 5,
// value: 'Yo',
// },
// ]