Skip to content

Commit

Permalink
Add limit value to mapLimit example (#1558)
Browse files Browse the repository at this point in the history
  • Loading branch information
abraham authored and aearly committed Jul 9, 2018
1 parent 1f3925e commit 00fe45e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion intro.md
Expand Up @@ -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))) {
Expand Down

0 comments on commit 00fe45e

Please sign in to comment.