https://github.com/cjg125/async-eachify
async-eachify
https://github.com/cjg125/async-eachify
async async-foreach each foreach
Last synced: 10 months ago
JSON representation
async-eachify
- Host: GitHub
- URL: https://github.com/cjg125/async-eachify
- Owner: cjg125
- Created: 2017-03-27T02:38:39.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-27T08:28:18.000Z (almost 9 years ago)
- Last Synced: 2025-02-24T16:53:46.208Z (11 months ago)
- Topics: async, async-foreach, each, foreach
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/async-eachify
- Size: 190 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# saync-eachify
## 简介
> 一个支持异步的迭代函数

```
## 安装
```html
```
```sh
yarn add async-eachify
```
## API
### 语法
```js
eachify(Array, callback, options)
```
### *Array*
> 要迭代的数组
### callback(loop, next)
#### *loop*
```js
// ['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](https://github.com/cjg125/async-eachify/tree/master/examples/middleware.js)