Each action for ChainyJS
Chainy action that iterates through each item in the array with an asynchronous or synchronous iterator
Use the each plugin like so:
// Iterate over an array// Iterate over an object// Iterate with some custom options to use for the internal taskgroup
The iterator can operate synchronously:
Or asynchronously:
Or asynchronously with the item's index/key as well:
The taskgroupOptions
is an optional configuration object that can be used to configure the internal taskgroup. A common use case for this is to instead of having our iterators operate serially (one after the other, a concurrency of 1), instead we could have them all operate at once (with a concurrency of 0) by specifying the following taskgroup configuration like so:
Tying this all together, we can do things like:
// --------------------------------// Array data// Synchronous iterator// Asynchronous iterator// Asynchronous iterator with index// --------------------------------// Object data// Synchronous iterator// Asynchronous iterator// Asynchronous iterator with index
Install
npm install --save chainy-plugin-each
require('chainy-plugin-each')
npm install --save chainy-plugin-each
require('chainy-plugin-each')
//wzrd.in/bundle/chainy-plugin-each@1.1.0
ender add chainy-plugin-each
require('chainy-plugin-each')
Editions
This package is published with the following editions:
chainy-plugin-each
aliaseschainy-plugin-each/source/index.js
chainy-plugin-each/source/index.js
is Source + ES5 + Require
History
Discover the release history by heading on over to the HISTORY.md
file.
Contribute
Discover how you can contribute by heading on over to the CONTRIBUTING.md
file.
Backers
Maintainers
These amazing people are maintaining this project:
Sponsors
No sponsors yet! Will you be the first?
Contributors
No contributors yet! Will you be the first?
Discover how you can contribute by heading on over to the CONTRIBUTING.md
file.
License
Unless stated otherwise all works are:
- Copyright © 2014+ Bevry Pty Ltd
and licensed under: