@karmaniverous/async-find

2.1.7 • Public • Published

async-find

To install:

npm install @karmaniverous/async-find

To import:

import { asyncFind } from '@karmaniverous/async-find`;

See tests for examples of usage!

API Documentation

Functions

asyncFind(values, predicates)Array

Step through a array of input values. Pass each input value through an array of async predicate functions, passing the output of each predicate as the input of the next, until either the predicates are exhausted or one of them returns a falsy result.

Typedefs

Predicate*

async predicate function callback

asyncFind(values, predicates) ⇒ Array

Step through a array of input values. Pass each input value through an array of async predicate functions, passing the output of each predicate as the input of the next, until either the predicates are exhausted or one of them returns a falsy result.

Kind: global function
Returns: Array - An array containing the first input value that survived all predicates, and its final predicate output.

Param Type Description
values Array array of values
predicates Array.<Predicate> array of async predicate functions

Predicate ⇒ *

async predicate function callback

Kind: global typedef
Returns: * - output

Param Type Description
[value] * value to be tested

See more great templates and other tools on my GitHub Profile!

Readme

Keywords

Package Sidebar

Install

npm i @karmaniverous/async-find

Weekly Downloads

1

Version

2.1.7

License

BSD-3-Clause

Unpacked Size

7.08 kB

Total Files

8

Last publish

Collaborators

  • karmaniverous