async-eachify

1.2.0 • Public • Published

saync-eachify

简介

一个支持异步的迭代函数

image

## 安装
```html
<script src="https://unpkg.com/async-eachify"></script>
yarn add async-eachify

API

语法

eachify(Array, callback, options)

Array

要迭代的数组

callback(loop, next)

loop

// ['a', 'b', 'c', 'd', 'e']
{
  index:0,
  len:4,
  value: 'a',
  first: true,
  last: false,
}

next

通过调用 next 迭代

options

options.async

是否异步迭代 默认值 false

interval.async

async 为 true 每次迭代的间隔时间

高级应用

examples/middleware.js

Readme

Keywords

none

Package Sidebar

Install

npm i async-eachify

Weekly Downloads

2

Version

1.2.0

License

MIT

Last publish

Collaborators

  • cjg