Fixed chainAsync() skipping the first function in the array.

This commit is contained in:
Oscar
2018-02-01 17:23:17 +00:00
parent 9ef0459e71
commit 4358adfa4d

View File

@ -9,7 +9,7 @@ The tenerary function checks the next function exists before calling it, otherwi
```js
const chainAsync = fns => {
let curr = 0;
const next = () => (fns[++curr] ? fns[curr](next) : false);
const next = () => (fns[curr] ? fns[curr++](next) : false);
next();
};
```