mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
* [p-map] introduce typings * [p-map] simplify according to review discussion
19 lines
337 B
TypeScript
19 lines
337 B
TypeScript
import pMap = require('p-map');
|
|
|
|
const sites = [
|
|
Promise.resolve('sindresorhus'),
|
|
true,
|
|
1
|
|
];
|
|
|
|
const mapper = (el: number | string | boolean) => Promise.resolve(1);
|
|
|
|
let num: number;
|
|
pMap(sites, mapper, {concurrency: 2}).then(result => {
|
|
num = result[3];
|
|
});
|
|
|
|
pMap(sites, mapper).then(result => {
|
|
num = result[3];
|
|
});
|