This package has been deprecated

Author message:

not used anymore, try any A-promise impl

async-parts

0.2.2 • Public • Published

Build Status NPM version Coverage Status

var Async = require('async-parts');
 
// next()-chained async tasks
(new Async)
  .catch(function(err, next) {
    if (err) {
      console.log(err);
    }
    next();
  })
  .then(function(next) {
    next(/* error, data, ... */);
    // or throw new Error(...)
  })
  .run(function(err, data) {
    // err will be empty on success
    // data will be collected from next()
  });

Usage

new Async(context) will expose three methods:

  • catch(handler) — Error handler for the chain
  • then(handler) — Adds a subtask to chain
  • run(success) — Initialize the chain

The created chain will be consumed until there are no more subtasks to invoke.

The constructor function can accept a context that will be bound on each callback.

Async.queue() is deprecated since 0.2.0.

Readme

Keywords

none

Package Sidebar

Install

npm i async-parts

Weekly Downloads

9

Version

0.2.2

License

MIT

Last publish

Collaborators

  • pateketrueke