diff options
author | Abraham Williams <4braham@gmail.com> | 2018-07-09 13:24:51 -0500 |
---|---|---|
committer | Alex Early <alexander.early@gmail.com> | 2018-07-09 11:24:51 -0700 |
commit | 00fe45e092fa1bb1f4c27d078c7a467f53e17b03 (patch) | |
tree | b65027f87f9b5a2dd32e899f474813e43818b6c2 | |
parent | 1f3925eb5b97bad4da8d225eb61ce75c728d6760 (diff) | |
download | async-00fe45e092fa1bb1f4c27d078c7a467f53e17b03.tar.gz |
Add limit value to `mapLimit` example (#1558)
-rw-r--r-- | intro.md | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -124,7 +124,7 @@ It is always good practice to `return callback(err, result)` whenever a callbac Async accepts `async` functions wherever we accept a Node-style callback function. However, we do not pass them a callback, and instead use the return value and handle any promise rejections or errors thrown. ```js -async.mapLimit(files, async file => { // <- no callback! +async.mapLimit(files, 10, async file => { // <- no callback! const text = await util.promisify(fs.readFile)(dir + file, 'utf8') const body = JSON.parse(text) // <- a parse error herre will be caught automatically if (!(await checkValidity(body))) { |