# blue-queue-pipe

> blue-queue-pipe

Latest version **1.1.4** (published 2021-04-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install blue-queue-pipe
pnpm add blue-queue-pipe
yarn add blue-queue-pipe
bun add blue-queue-pipe
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2021-04-20 |
| First published | 2019-04-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 45.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Blue |
| Maintainers | blue_fu |

## Links

- npm: https://www.npmjs.com/package/blue-queue-pipe
- Repository: https://github.com/Azhanging/blue-queue-pipe
- Homepage: https://github.com/Azhanging/blue-queue-pipe#readme
- Issues: https://github.com/Azhanging/blue-queue-pipe
- npm.io page: https://npm.io/package/blue-queue-pipe

## Recent versions

- 1.1.4 (latest) — 2021-04-20
- 1.1.3 — 2021-04-14
- 1.1.2 — 2021-04-12
- 1.1.1 — 2020-04-03
- 1.1.0 — 2020-04-02
- 1.0.9 — 2020-03-28
- 1.0.8 — 2020-03-27
- 1.0.6 — 2019-06-28
- 1.0.5 — 2019-06-28
- 1.0.4 — 2019-06-28
- 1.0.3 — 2019-04-25
- 1.0.2 — 2019-04-10
- 1.0.1 — 2019-04-10
- 1.0.0 — 2019-04-10

## README

# blue-queue-pipe

队列处理

### BlueQueuePipe

大致的使用预览
```javascript
    var blueQueue = new BlueQueuePipe({
      data:{},
      methods:{
        someMethod:function(){
          //this指向当前队列实例
        }
      },
      enqueued:function(){
        //this指向当前队列实例
      },
      dequeued:function(){
        //this指向当前队列实例
      }
    });

    setTimeout(function () {
      blueQueue.useMethod('setStatus', [true]);
    }, 0);

    blueQueue.enqueue(function () {
      console.log(1);
    });

    blueQueue.enqueue(function () {
      console.log(2);
    });

    blueQueue.enqueue(function () {
      console.log(3);
    });

    blueQueue.enqueue(123);

    blueQueue.run();
```

#### 实例属性

data:实例化带入的data

queue:队列数组

options:默认带入的配置

methods:实例化带入的methods

#### 钩子
enqueued: 每次enqueue后调用的钩子，this指向队列实例，
带入的参数为enqueue后的返回值

dequeued: 每次dequeue后调用的钩子，this指向队列实例，
带入的参数为dequeue的值

running: 在dequeue run后执行

ran: run结束后执行：running -> dequeued(n) -> ran


#### prototype methods
_init(opts): 初始化方法

enqueue(any):void 加入队列

dequeue():any 离开队列，返回离开队列的obj

isEmpty():boolean 检查当前队列是否为空

clear():void 清空队列

first():any 获取到第一个队列

last():any 获取到最后一个队列

run(arguments):void 执行队列，arguments会被带入到function类型的dequeue中执行

hook(ctx,fn,args[]):any 执行fn使用

useMethod(methodName,args[]):any 使用某一个在methods定义的方法

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