Travis build: 391

This commit is contained in:
Travis CI
2017-12-28 08:30:19 +00:00
parent ae7fbdc16d
commit 3cbd7040e9
141 changed files with 1389 additions and 1044 deletions

View File

@ -5,13 +5,25 @@ Chains asynchronous functions.
Loop through an array of functions containing asynchronous events, calling `next` when each asynchronous event has completed.
```js
const chainAsync = fns => { let curr = 0; const next = () => fns[curr++](next); next(); };
const chainAsync = fns => {
let curr = 0;
const next = () => fns[curr++](next);
next();
};
```
```js
chainAsync([
next => { console.log('0 seconds'); setTimeout(next, 1000); },
next => { console.log('1 second'); setTimeout(next, 1000); },
next => { console.log('2 seconds'); }
])
next => {
console.log('0 seconds');
setTimeout(next, 1000);
},
next => {
console.log('1 second');
setTimeout(next, 1000);
},
next => {
console.log('2 seconds');
}
]);
```