# @feizheng/next-async-queue

> Async queue for next.

Latest version **1.0.2** (published 2020-02-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @feizheng/next-async-queue
pnpm add @feizheng/next-async-queue
yarn add @feizheng/next-async-queue
bun add @feizheng/next-async-queue
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2020-02-16 |
| First published | 2020-02-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 12.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | afei |
| Maintainers | afeiship |

## Links

- npm: https://www.npmjs.com/package/@feizheng/next-async-queue
- Homepage: https://github.com/afeiship/next-async-queue
- npm.io page: https://npm.io/package/@feizheng/next-async-queue

## Dependencies (2)

- [@feizheng/next-js-core2](https://npm.io/package/@feizheng/next-js-core2.md) ^2.4.1
- [@feizheng/next-repeat-by](https://npm.io/package/@feizheng/next-repeat-by.md) ^1.1.1

## Recent versions

- 1.0.2 (latest) — 2020-02-16
- 1.0.1 — 2020-02-16
- 1.0.0 — 2020-02-03

## README

# next-async-queue
> Async queue for next.

## installation
```bash
npm install -S @feizheng/next-async-queue
```

## apis
| api    | params    | description                           |
| ------ | --------- | ------------------------------------- |
| run    | items     | Run a list of async functions         |
| repeat | fn, count | Get a repeat functions                |
| wrap   | [fn,fn]   | Wrap an list of functions to runnable |

## status
| status | name | code | description                   |
| ------ | ---- | ---- | ----------------------------- |
| LOAD   | load | 1    | Status when task is running   |
| DONE   | done | 0    | Status when all task has done |

## usage
```js
import NxAsyncQueue from '@feizheng/next-async-queue';

var fn1 = function(next){
  setTimeout(function(){
    console.log(123,'1s');
    next({ result: 1});
  },1000);
};

var fn2 = function(next){
  setTimeout(function(){
    console.log(456,'2s');
    next({ result: 2});
  },1000);
};

var fn3 = function(next){
  setTimeout(function(){
    console.log(789,'3s');
    next({ result: 3});
  },1000);
};

NxAsyncQueue.run(fn1, fn2, fn3).then((res) => {
  console.log(res);
});

// results:
// 123 1s
// 456 2s
// 789 3s
// [ { result: 1 }, { result: 2 }, { result: 3 } ]
```

---
_Source: https://npm.io/package/@feizheng/next-async-queue · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
