Cutie extension for processing collections and utility stuff. It's based on the Async Tree Pattern.
You can find examples of using this library in the test directory.
npm install @cuties/async
npm test
npm run build
const {
// Needed async objects here from the list below
} = require('@cuties/async')
Applies iteratee
to each item in collection
, concatenating the results.
Params:
collection
: a collection(an array) to iterate overiteratee
: a function to apply to each item incollection
. It must return some value or a composition of async objects that represents some value.
Filters collection
by filter
function that returns boolean expression or async object that represents some boolean expression for each item.
Params:
collection
: a collection(an array) to filterfilter
: a function to filtercollection
Groups values from collections
by key
.
Params:
collection
: a collection(an array) to group bykey
: a key thatcollection
is grouped by
Represents array or object that was mapped by mapper
from collection
. mapper
can return async object that precesses each item of collection
.
Params:
collection
: a collection(an array or object) to be mappedmapper
: a function for mapping
The opposite of filter.
Represents some result
that can be used after some specified time
. It's a wrapper around setTimeout
Represents objs
that have been printed to console.