mol_jsx_lib 0.0.660 → 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.mjs CHANGED
@@ -1633,7 +1633,18 @@ var $;
1633
1633
  }
1634
1634
  if (!$mol_promise_like(this.cache))
1635
1635
  return this.cache;
1636
- await this.cache;
1636
+ await Promise.race([
1637
+ this.cache,
1638
+ new Promise(done => {
1639
+ const sub = new $mol_wire_pub_sub;
1640
+ const prev = sub.track_on();
1641
+ sub.track_next(this);
1642
+ sub.track_off(prev);
1643
+ sub.absorb = done;
1644
+ })
1645
+ ]);
1646
+ if (!$mol_promise_like(this.cache))
1647
+ return this.cache;
1637
1648
  if (this.cursor === $mol_wire_cursor.final) {
1638
1649
  await new Promise(() => { });
1639
1650
  }
package/node.test.js CHANGED
@@ -1625,7 +1625,18 @@ var $;
1625
1625
  }
1626
1626
  if (!$mol_promise_like(this.cache))
1627
1627
  return this.cache;
1628
- await this.cache;
1628
+ await Promise.race([
1629
+ this.cache,
1630
+ new Promise(done => {
1631
+ const sub = new $mol_wire_pub_sub;
1632
+ const prev = sub.track_on();
1633
+ sub.track_next(this);
1634
+ sub.track_off(prev);
1635
+ sub.absorb = done;
1636
+ })
1637
+ ]);
1638
+ if (!$mol_promise_like(this.cache))
1639
+ return this.cache;
1629
1640
  if (this.cursor === $mol_wire_cursor.final) {
1630
1641
  await new Promise(() => { });
1631
1642
  }
@@ -4572,6 +4583,31 @@ var $;
4572
4583
  var $;
4573
4584
  (function ($_1) {
4574
4585
  $mol_test({
4586
+ async 'Error caching'($) {
4587
+ const next_cached = 123;
4588
+ class Some extends $mol_object2 {
4589
+ static $ = $;
4590
+ static data(id, next) {
4591
+ if (next)
4592
+ return next;
4593
+ setTimeout(() => {
4594
+ $mol_wire_async(this).data(id, next_cached);
4595
+ }, 10);
4596
+ $mol_fail_hidden(new Promise(() => { }));
4597
+ }
4598
+ static run() {
4599
+ return this.data('1');
4600
+ }
4601
+ }
4602
+ __decorate([
4603
+ $mol_wire_plex
4604
+ ], Some, "data", null);
4605
+ __decorate([
4606
+ $mol_wire_method
4607
+ ], Some, "run", null);
4608
+ const val = await $mol_wire_async(Some).run();
4609
+ $mol_assert_equal(val, next_cached);
4610
+ },
4575
4611
  'Memoize by single simple key'($) {
4576
4612
  class Team extends $mol_object2 {
4577
4613
  static $ = $;