mol_wire_lib 1.0.249 → 1.0.252

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/node.js CHANGED
@@ -1219,6 +1219,30 @@ var $;
1219
1219
  //mol/wire/async/async.ts
1220
1220
  ;
1221
1221
  "use strict";
1222
+ var $;
1223
+ (function ($) {
1224
+ function $mol_wire_race(...tasks) {
1225
+ const results = tasks.map(task => {
1226
+ try {
1227
+ return task();
1228
+ }
1229
+ catch (error) {
1230
+ return error;
1231
+ }
1232
+ });
1233
+ const promises = results.filter(res => res instanceof Promise);
1234
+ if (promises.length)
1235
+ $mol_fail(Promise.race(promises));
1236
+ const error = results.find(res => res instanceof Error);
1237
+ if (error)
1238
+ $mol_fail(error);
1239
+ return results;
1240
+ }
1241
+ $.$mol_wire_race = $mol_wire_race;
1242
+ })($ || ($ = {}));
1243
+ //mol/wire/race/race.ts
1244
+ ;
1245
+ "use strict";
1222
1246
  //mol/type/tail/tail.ts
1223
1247
  ;
1224
1248
  "use strict";