@cuties/async
Cutie extension for manipulating collections, such as arrays and objects, for controlling the flow through a script, and utility stuff.
Last updated a year ago by guseyn .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @cuties/async 
SYNC missed versions from official npm registry.

cutie-async

NPM Version Build Status codecov

Cutie extension for processing collections and utility stuff. It's based on the Async Tree Pattern.

Examples

You can find examples of using this library in the test directory.

Install

npm install @cuties/async

Run test

npm test

Run build

npm run build

Usage

const {
  // Needed async objects here from the list below
} = require('@cuties/async')

Collections

Concatenated(collection, iteratee)

Applies iteratee to each item in collection, concatenating the results.

Params:

  • collection: a collection(an array) to iterate over
  • iteratee: a function to apply to each item in collection. It must return some value or a composition of async objects that represents some value.

Filtered(collection, filter)

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 filter
  • filter: a function to filter collection

GroupedBy(collection, key)

Groups values from collections by key.

Params:

  • collection: a collection(an array) to group by
  • key: a key that collection is grouped by

Mapped(collection, mapper)

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 mapped
  • mapper: a function for mapping

Rejected(collection, filter)

The opposite of filter.

Utils

Delayed(result, time)

Represents some result that can be used after some specified time. It's a wrapper around setTimeout

Logged(...objs)

Represents objs that have been printed to console.

Current Tags

  • 1.0.1                                ...           latest (a year ago)

2 Versions

  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (8)
Dev Dependencies (6)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |