mol_wire_lib 1.0.430 → 1.0.431

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
@@ -1040,6 +1040,12 @@ var $;
1040
1040
  //mol/wire/method/method.ts
1041
1041
  ;
1042
1042
  "use strict";
1043
+ //mol/type/tail/tail.ts
1044
+ ;
1045
+ "use strict";
1046
+ //mol/type/foot/foot.ts
1047
+ ;
1048
+ "use strict";
1043
1049
  var $;
1044
1050
  (function ($) {
1045
1051
  class $mol_wire_atom extends $mol_wire_fiber {
@@ -1093,6 +1099,20 @@ var $;
1093
1099
  once() {
1094
1100
  return this.sync();
1095
1101
  }
1102
+ channel() {
1103
+ return Object.assign((next) => {
1104
+ if (next !== undefined)
1105
+ return this.resync([...this.args, next]);
1106
+ if (!$mol_wire_fiber.warm)
1107
+ return this.result();
1108
+ if ($mol_wire_auto() instanceof $mol_wire_task) {
1109
+ return this.once();
1110
+ }
1111
+ else {
1112
+ return this.sync();
1113
+ }
1114
+ }, { atom: this });
1115
+ }
1096
1116
  destructor() {
1097
1117
  super.destructor();
1098
1118
  const prev = this.cache;
@@ -1277,9 +1297,6 @@ var $;
1277
1297
  //mol/wire/race/race.ts
1278
1298
  ;
1279
1299
  "use strict";
1280
- //mol/type/tail/tail.ts
1281
- ;
1282
- "use strict";
1283
1300
  var $;
1284
1301
  (function ($) {
1285
1302
  function $mol_wire_solo(host, field, descr) {
@@ -1508,6 +1525,22 @@ var $;
1508
1525
  //mol/wire/patch/patch.ts
1509
1526
  ;
1510
1527
  "use strict";
1528
+ //mol/type/result/result.ts
1529
+ ;
1530
+ "use strict";
1531
+ var $;
1532
+ (function ($) {
1533
+ function $mol_wire_let(host) {
1534
+ for (const field of Object.keys(host)) {
1535
+ host[field] = new $mol_wire_atom(field, host[field], host).channel();
1536
+ }
1537
+ return host;
1538
+ }
1539
+ $.$mol_wire_let = $mol_wire_let;
1540
+ })($ || ($ = {}));
1541
+ //mol/wire/let/let.ts
1542
+ ;
1543
+ "use strict";
1511
1544
  var $;
1512
1545
  (function ($) {
1513
1546
  class $mol_wire_set extends Set {