mol_jsx_lib 0.0.659 → 0.0.661
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.deps.json +1 -1
- package/node.js +12 -1
- package/node.js.map +1 -1
- package/node.mjs +12 -1
- package/node.test.js +44 -2
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.deps.json +1 -1
- package/web.js +12 -1
- package/web.js.map +1 -1
- package/web.mjs +12 -1
- package/web.test.js +32 -1
- package/web.test.js.map +1 -1
package/web.mjs
CHANGED
|
@@ -1036,7 +1036,18 @@ var $;
|
|
|
1036
1036
|
}
|
|
1037
1037
|
if (!$mol_promise_like(this.cache))
|
|
1038
1038
|
return this.cache;
|
|
1039
|
-
await
|
|
1039
|
+
await Promise.race([
|
|
1040
|
+
this.cache,
|
|
1041
|
+
new Promise(done => {
|
|
1042
|
+
const sub = new $mol_wire_pub_sub;
|
|
1043
|
+
const prev = sub.track_on();
|
|
1044
|
+
sub.track_next(this);
|
|
1045
|
+
sub.track_off(prev);
|
|
1046
|
+
sub.absorb = done;
|
|
1047
|
+
})
|
|
1048
|
+
]);
|
|
1049
|
+
if (!$mol_promise_like(this.cache))
|
|
1050
|
+
return this.cache;
|
|
1040
1051
|
if (this.cursor === $mol_wire_cursor.final) {
|
|
1041
1052
|
await new Promise(() => { });
|
|
1042
1053
|
}
|
package/web.test.js
CHANGED
|
@@ -194,7 +194,7 @@ var $;
|
|
|
194
194
|
if ('outerHTML' in val)
|
|
195
195
|
return val.outerHTML;
|
|
196
196
|
try {
|
|
197
|
-
return JSON.stringify(val);
|
|
197
|
+
return JSON.stringify(val, null, '\t');
|
|
198
198
|
}
|
|
199
199
|
catch (error) {
|
|
200
200
|
console.error(error);
|
|
@@ -241,6 +241,12 @@ var $;
|
|
|
241
241
|
'three must be alike'() {
|
|
242
242
|
$mol_assert_like([3], [3], [3]);
|
|
243
243
|
},
|
|
244
|
+
'two object must be alike'() {
|
|
245
|
+
$mol_assert_like({ a: 1 }, { a: 1 });
|
|
246
|
+
},
|
|
247
|
+
'three object must be alike'() {
|
|
248
|
+
$mol_assert_like({ a: 1 }, { a: 1 }, { a: 1 });
|
|
249
|
+
},
|
|
244
250
|
});
|
|
245
251
|
})($ || ($ = {}));
|
|
246
252
|
//mol/assert/assert.test.ts
|
|
@@ -1670,6 +1676,31 @@ var $;
|
|
|
1670
1676
|
var $;
|
|
1671
1677
|
(function ($_1) {
|
|
1672
1678
|
$mol_test({
|
|
1679
|
+
async 'Error caching'($) {
|
|
1680
|
+
const next_cached = 123;
|
|
1681
|
+
class Some extends $mol_object2 {
|
|
1682
|
+
static $ = $;
|
|
1683
|
+
static data(id, next) {
|
|
1684
|
+
if (next)
|
|
1685
|
+
return next;
|
|
1686
|
+
setTimeout(() => {
|
|
1687
|
+
$mol_wire_async(this).data(id, next_cached);
|
|
1688
|
+
}, 10);
|
|
1689
|
+
$mol_fail_hidden(new Promise(() => { }));
|
|
1690
|
+
}
|
|
1691
|
+
static run() {
|
|
1692
|
+
return this.data('1');
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
__decorate([
|
|
1696
|
+
$mol_wire_plex
|
|
1697
|
+
], Some, "data", null);
|
|
1698
|
+
__decorate([
|
|
1699
|
+
$mol_wire_method
|
|
1700
|
+
], Some, "run", null);
|
|
1701
|
+
const val = await $mol_wire_async(Some).run();
|
|
1702
|
+
$mol_assert_equal(val, next_cached);
|
|
1703
|
+
},
|
|
1673
1704
|
'Memoize by single simple key'($) {
|
|
1674
1705
|
class Team extends $mol_object2 {
|
|
1675
1706
|
static $ = $;
|