paralysis 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,6 +5,9 @@ Maps over promises concurrently.
5
5
  ```js
6
6
  import parallel from "paralysis";
7
7
 
8
+ const ids = [1, 2, 3, 4, 5];
9
+ const concurrency = 2;
10
+
8
11
  async function getUser(id) {
9
12
  const response = await fetch(
10
13
  `https://jsonplaceholder.typicode.com/users/${id}`,
@@ -13,7 +16,7 @@ async function getUser(id) {
13
16
  return user;
14
17
  }
15
18
 
16
- const users = await parallel([1, 2, 3, 4, 5], getUser, 2);
19
+ const users = await parallel(ids, getUser, concurrency);
17
20
  ```
18
21
 
19
22
  This is similar to
package/dist/index.d.cts CHANGED
@@ -9,6 +9,9 @@ type Promisable<T> = T | PromiseLike<T>;
9
9
  * ```js
10
10
  * import parallel from "paralysis";
11
11
  *
12
+ * const ids = [1, 2, 3, 4, 5];
13
+ * const concurrency = 2;
14
+ *
12
15
  * async function getUser(id) {
13
16
  * const response = await fetch(
14
17
  * `https://jsonplaceholder.typicode.com/users/${id}`,
@@ -17,7 +20,7 @@ type Promisable<T> = T | PromiseLike<T>;
17
20
  * return user;
18
21
  * }
19
22
  *
20
- * const users = await parallel([1, 2, 3, 4, 5], getUser, 2);
23
+ * const users = await parallel(ids, getUser, concurrency);
21
24
  * ```
22
25
  *
23
26
  * @param list List that is iterated over concurrently, calling `fn` for each item.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sources":["../src/index.d.ts"],"mappings":"AAAA,KAAK,UAAU,UAAU,WAAW;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;iBACwB,SAAS;AACjC,QAAQ,SAAS;AACjB,qCAAqC,UAAU;AAC/C;AACA,GAAG,OAAO,CAAC,KAAK;;;;","names":[]}
1
+ {"version":3,"file":"index.d.cts","sources":["../src/index.d.ts"],"mappings":"AAAA,KAAK,UAAU,UAAU,WAAW;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;iBACwB,SAAS;AACjC,QAAQ,SAAS;AACjB,qCAAqC,UAAU;AAC/C;AACA,GAAG,OAAO,CAAC,KAAK;;;;","names":[]}
package/dist/index.d.mts CHANGED
@@ -9,6 +9,9 @@ type Promisable<T> = T | PromiseLike<T>;
9
9
  * ```js
10
10
  * import parallel from "paralysis";
11
11
  *
12
+ * const ids = [1, 2, 3, 4, 5];
13
+ * const concurrency = 2;
14
+ *
12
15
  * async function getUser(id) {
13
16
  * const response = await fetch(
14
17
  * `https://jsonplaceholder.typicode.com/users/${id}`,
@@ -17,7 +20,7 @@ type Promisable<T> = T | PromiseLike<T>;
17
20
  * return user;
18
21
  * }
19
22
  *
20
- * const users = await parallel([1, 2, 3, 4, 5], getUser, 2);
23
+ * const users = await parallel(ids, getUser, concurrency);
21
24
  * ```
22
25
  *
23
26
  * @param list List that is iterated over concurrently, calling `fn` for each item.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sources":["../src/index.d.ts"],"mappings":"AAAA,KAAK,UAAU,UAAU,WAAW;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;iBACwB,SAAS;AACjC,QAAQ,SAAS;AACjB,qCAAqC,UAAU;AAC/C;AACA,GAAG,OAAO,CAAC,KAAK;;;;","names":[]}
1
+ {"version":3,"file":"index.d.mts","sources":["../src/index.d.ts"],"mappings":"AAAA,KAAK,UAAU,UAAU,WAAW;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;iBACwB,SAAS;AACjC,QAAQ,SAAS;AACjB,qCAAqC,UAAU;AAC/C;AACA,GAAG,OAAO,CAAC,KAAK;;;;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paralysis",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Map over promises concurrently",
5
5
  "repository": "th3rius/paralysis",
6
6
  "keywords": [