more-proms 1.4.0 → 1.4.1
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.
|
@@ -134,11 +134,11 @@ function allOrRace(allOrRace, proms, ifOneChildCancels = "ignore") {
|
|
|
134
134
|
return proms.map((p) => p.cancel());
|
|
135
135
|
});
|
|
136
136
|
if (ifOneChildCancels === "ignore")
|
|
137
|
-
Promise.all(proms.map((p) => p.
|
|
137
|
+
Promise.all(proms.map((p) => p.onCancel)).then(newP.cancel);
|
|
138
138
|
else if (ifOneChildCancels === "cancelThis")
|
|
139
|
-
Promise.race(proms.map((p) => p.
|
|
139
|
+
Promise.race(proms.map((p) => p.onCancel)).then(newP.cancel);
|
|
140
140
|
else if (ifOneChildCancels === "cancelAll")
|
|
141
|
-
Promise.all(proms.map((p) => p.
|
|
141
|
+
Promise.all(proms.map((p) => p.onCancel)).then(() => {
|
|
142
142
|
for (const prom of proms)
|
|
143
143
|
prom.cancel();
|
|
144
144
|
newP.cancel();
|
|
@@ -131,11 +131,11 @@ function allOrRace(allOrRace, proms, ifOneChildCancels = "ignore") {
|
|
|
131
131
|
return proms.map((p) => p.cancel());
|
|
132
132
|
});
|
|
133
133
|
if (ifOneChildCancels === "ignore")
|
|
134
|
-
Promise.all(proms.map((p) => p.
|
|
134
|
+
Promise.all(proms.map((p) => p.onCancel)).then(newP.cancel);
|
|
135
135
|
else if (ifOneChildCancels === "cancelThis")
|
|
136
|
-
Promise.race(proms.map((p) => p.
|
|
136
|
+
Promise.race(proms.map((p) => p.onCancel)).then(newP.cancel);
|
|
137
137
|
else if (ifOneChildCancels === "cancelAll")
|
|
138
|
-
Promise.all(proms.map((p) => p.
|
|
138
|
+
Promise.all(proms.map((p) => p.onCancel)).then(() => {
|
|
139
139
|
for (const prom of proms)
|
|
140
140
|
prom.cancel();
|
|
141
141
|
newP.cancel();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "more-proms",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "A collection of additional promise extending classes. Including a (from the outside) ResablePromise, CancelAblePromise and a latestLatent utility function.",
|
|
5
5
|
"main": "./app/dist/esm/moreProms.mjs",
|
|
6
6
|
"types": "./app/dist/esm/moreProms.d.ts",
|