Skip to content

Commit

Permalink
Meta tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Aug 18, 2019
1 parent 6d593b1 commit 18ac29e
Showing 4 changed files with 9 additions and 10 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
language: node_js
node_js:
- '12'
- '10'
- '8'
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -34,9 +34,9 @@
"p-map": "^3.0.0"
},
"devDependencies": {
"ava": "^1.4.1",
"ava": "^2.2.0",
"delay": "^4.1.0",
"in-range": "^1.0.0",
"in-range": "^2.0.0",
"time-span": "^3.0.0",
"tsd": "^0.7.1",
"xo": "^0.24.0"
9 changes: 2 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
@@ -104,7 +104,7 @@ const runJob = PProgress.fn(async (name, progress) => {
})();
```

### PProgress.all(promises, [options])
### PProgress.all(promises, options?)

Convenience method to run multiple promises and get a total progress of all of them. It counts normal promises with progress `0` when pending and progress `1` when resolved. For `PProgress` type promises, it listens to their `onProgress()` method for more fine grained progress reporting. You can mix and match normal promises and `PProgress` promises.

@@ -152,7 +152,7 @@ Array of promises or promise-returning functions, similar to [p-all](https://git

#### options

Type: `Object`
Type: `object`

##### concurrency

@@ -171,8 +171,3 @@ When this option is set, the first argument must be an array of promise-returnin

- [p-cancelable](https://github.com/sindresorhus/p-cancelable) - Create a promise that can be canceled
- [More…](https://github.com/sindresorhus/promise-fun)


## License

MIT © [Sindre Sorhus](https://sindresorhus.com)
5 changes: 4 additions & 1 deletion test.js
Original file line number Diff line number Diff line change
@@ -143,5 +143,8 @@ test('PProgress.all() with concurrency = 1', async t => {
fixture
]);

t.true(inRange(end(), 200 /* 4 delays of 50ms each */, 250 /* reasonable padding */));
t.true(inRange(end(), {
start: 200, // 4 delays of 50ms each
end: 250 // Reasonable padding
}));
});

0 comments on commit 18ac29e

Please sign in to comment.