GithubHelp home page GithubHelp logo

cutie-async's Introduction

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.

cutie-async's People

Contributors

guseyn avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.