mol_jsx_lib 0.0.113 → 0.0.116
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.d.ts +4 -0
- package/node.deps.json +1 -1
- package/node.esm.js +24 -0
- package/node.esm.js.map +1 -1
- package/node.js +24 -0
- package/node.js.map +1 -1
- package/node.test.js +24 -0
- package/node.test.js.map +1 -1
- package/package.json +2 -1
- package/web.d.ts +4 -0
- package/web.deps.json +1 -1
- package/web.esm.js +24 -0
- package/web.esm.js.map +1 -1
- package/web.js +24 -0
- package/web.js.map +1 -1
package/node.test.js
CHANGED
|
@@ -2137,6 +2137,30 @@ var $;
|
|
|
2137
2137
|
;
|
|
2138
2138
|
"use strict";
|
|
2139
2139
|
var $;
|
|
2140
|
+
(function ($) {
|
|
2141
|
+
function $mol_wire_race(...tasks) {
|
|
2142
|
+
const results = tasks.map(task => {
|
|
2143
|
+
try {
|
|
2144
|
+
return task();
|
|
2145
|
+
}
|
|
2146
|
+
catch (error) {
|
|
2147
|
+
return error;
|
|
2148
|
+
}
|
|
2149
|
+
});
|
|
2150
|
+
const promises = results.filter(res => res instanceof Promise);
|
|
2151
|
+
if (promises.length)
|
|
2152
|
+
$mol_fail(Promise.race(promises));
|
|
2153
|
+
const error = results.find(res => res instanceof Error);
|
|
2154
|
+
if (error)
|
|
2155
|
+
$mol_fail(error);
|
|
2156
|
+
return results;
|
|
2157
|
+
}
|
|
2158
|
+
$.$mol_wire_race = $mol_wire_race;
|
|
2159
|
+
})($ || ($ = {}));
|
|
2160
|
+
//mol/wire/race/race.ts
|
|
2161
|
+
;
|
|
2162
|
+
"use strict";
|
|
2163
|
+
var $;
|
|
2140
2164
|
(function ($) {
|
|
2141
2165
|
function $mol_wire_patch(obj) {
|
|
2142
2166
|
for (const field of Reflect.ownKeys(obj)) {
|