Revert changes to chainAsync.md

This commit is contained in:
Angelos Chalaris
2018-02-03 11:29:27 +02:00
parent f1ff5060d6
commit 80382c8b39

View File

@ -4,12 +4,10 @@ Chains asynchronous functions.
Loop through an array of functions containing asynchronous events, calling `next` when each asynchronous event has completed.
The tenerary function checks the next function exists before calling it, otherwise it will exit.
```js
const chainAsync = fns => {
let curr = 0;
const next = () => (fns[curr] ? fns[curr++](next) : false);
const next = () => fns[curr++](next);
next();
};
```