mol_wire_lib 1.0.103 → 1.0.104
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 +20 -20
- package/node.deps.json +1 -1
- package/node.esm.js +89 -89
- package/node.esm.js.map +1 -1
- package/node.js +89 -89
- package/node.js.map +1 -1
- package/node.test.js +89 -89
- package/node.test.js.map +1 -1
- package/package.json +8 -8
- package/web.d.ts +20 -20
- package/web.deps.json +1 -1
- package/web.esm.js +89 -89
- package/web.esm.js.map +1 -1
- package/web.js +89 -89
- package/web.js.map +1 -1
package/node.js
CHANGED
|
@@ -748,34 +748,6 @@ var $;
|
|
|
748
748
|
;
|
|
749
749
|
"use strict";
|
|
750
750
|
var $;
|
|
751
|
-
(function ($) {
|
|
752
|
-
function $mol_wire_probe(task, next) {
|
|
753
|
-
const warm = $mol_wire_fiber.warm;
|
|
754
|
-
try {
|
|
755
|
-
$mol_wire_fiber.warm = false;
|
|
756
|
-
return task();
|
|
757
|
-
}
|
|
758
|
-
finally {
|
|
759
|
-
$mol_wire_fiber.warm = warm;
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
$.$mol_wire_probe = $mol_wire_probe;
|
|
763
|
-
})($ || ($ = {}));
|
|
764
|
-
//mol/wire/probe/probe.ts
|
|
765
|
-
;
|
|
766
|
-
"use strict";
|
|
767
|
-
var $;
|
|
768
|
-
(function ($) {
|
|
769
|
-
function $mol_wire_solid() {
|
|
770
|
-
$mol_wire_auto().reap = nothing;
|
|
771
|
-
}
|
|
772
|
-
$.$mol_wire_solid = $mol_wire_solid;
|
|
773
|
-
const nothing = () => { };
|
|
774
|
-
})($ || ($ = {}));
|
|
775
|
-
//mol/wire/solid/solid.ts
|
|
776
|
-
;
|
|
777
|
-
"use strict";
|
|
778
|
-
var $;
|
|
779
751
|
(function ($) {
|
|
780
752
|
$.$mol_compare_deep_cache = new WeakMap();
|
|
781
753
|
function $mol_compare_deep(left, right) {
|
|
@@ -902,12 +874,12 @@ var $;
|
|
|
902
874
|
"use strict";
|
|
903
875
|
var $;
|
|
904
876
|
(function ($) {
|
|
905
|
-
class $
|
|
877
|
+
class $mol_wire_task extends $mol_wire_fiber {
|
|
906
878
|
static getter(task) {
|
|
907
879
|
return function $mol_wire_fiber_temp_get(host, args) {
|
|
908
880
|
const existen = $mol_wire_auto()?.track_next();
|
|
909
881
|
reuse: if (existen) {
|
|
910
|
-
if (!(existen instanceof $
|
|
882
|
+
if (!(existen instanceof $mol_wire_task))
|
|
911
883
|
break reuse;
|
|
912
884
|
if (existen.host !== host)
|
|
913
885
|
break reuse;
|
|
@@ -917,7 +889,7 @@ var $;
|
|
|
917
889
|
break reuse;
|
|
918
890
|
return existen;
|
|
919
891
|
}
|
|
920
|
-
return new $
|
|
892
|
+
return new $mol_wire_task(`${host?.[Symbol.toStringTag] ?? host}.${task.name}(#)`, task, host, ...args);
|
|
921
893
|
};
|
|
922
894
|
}
|
|
923
895
|
complete() {
|
|
@@ -940,53 +912,9 @@ var $;
|
|
|
940
912
|
return next;
|
|
941
913
|
}
|
|
942
914
|
}
|
|
943
|
-
$.$
|
|
944
|
-
})($ || ($ = {}));
|
|
945
|
-
//mol/wire/fiber/temp/temp.ts
|
|
946
|
-
;
|
|
947
|
-
"use strict";
|
|
948
|
-
var $;
|
|
949
|
-
(function ($) {
|
|
950
|
-
function $mol_wire_sync(obj) {
|
|
951
|
-
return new Proxy(obj, {
|
|
952
|
-
get(obj, field) {
|
|
953
|
-
const val = obj[field];
|
|
954
|
-
if (typeof val !== 'function')
|
|
955
|
-
return val;
|
|
956
|
-
const temp = $mol_wire_fiber_temp.getter(val);
|
|
957
|
-
return function $mol_wire_sync(...args) {
|
|
958
|
-
const fiber = temp(obj, args);
|
|
959
|
-
return fiber.sync();
|
|
960
|
-
};
|
|
961
|
-
}
|
|
962
|
-
});
|
|
963
|
-
}
|
|
964
|
-
$.$mol_wire_sync = $mol_wire_sync;
|
|
915
|
+
$.$mol_wire_task = $mol_wire_task;
|
|
965
916
|
})($ || ($ = {}));
|
|
966
|
-
//mol/wire/
|
|
967
|
-
;
|
|
968
|
-
"use strict";
|
|
969
|
-
var $;
|
|
970
|
-
(function ($) {
|
|
971
|
-
function $mol_wire_async(obj) {
|
|
972
|
-
return new Proxy(obj, {
|
|
973
|
-
get(obj, field) {
|
|
974
|
-
const val = obj[field];
|
|
975
|
-
if (typeof val !== 'function')
|
|
976
|
-
return val;
|
|
977
|
-
let fiber;
|
|
978
|
-
const temp = $mol_wire_fiber_temp.getter(val);
|
|
979
|
-
return function $mol_wire_async(...args) {
|
|
980
|
-
fiber?.destructor();
|
|
981
|
-
fiber = temp(obj, args);
|
|
982
|
-
return fiber.async();
|
|
983
|
-
};
|
|
984
|
-
}
|
|
985
|
-
});
|
|
986
|
-
}
|
|
987
|
-
$.$mol_wire_async = $mol_wire_async;
|
|
988
|
-
})($ || ($ = {}));
|
|
989
|
-
//mol/wire/async/async.ts
|
|
917
|
+
//mol/wire/task/task.ts
|
|
990
918
|
;
|
|
991
919
|
"use strict";
|
|
992
920
|
var $;
|
|
@@ -1051,7 +979,7 @@ var $;
|
|
|
1051
979
|
if (typeof sup[field] === 'function') {
|
|
1052
980
|
Object.defineProperty(orig, 'name', { value: sup[field].name });
|
|
1053
981
|
}
|
|
1054
|
-
const temp = $
|
|
982
|
+
const temp = $mol_wire_task.getter(orig);
|
|
1055
983
|
const value = function (...args) {
|
|
1056
984
|
const fiber = temp(this ?? null, args);
|
|
1057
985
|
return fiber.sync();
|
|
@@ -1069,7 +997,7 @@ var $;
|
|
|
1069
997
|
"use strict";
|
|
1070
998
|
var $;
|
|
1071
999
|
(function ($) {
|
|
1072
|
-
class $
|
|
1000
|
+
class $mol_wire_atom extends $mol_wire_fiber {
|
|
1073
1001
|
static getter(task, keys) {
|
|
1074
1002
|
const field = task.name + '()';
|
|
1075
1003
|
if (keys) {
|
|
@@ -1085,7 +1013,7 @@ var $;
|
|
|
1085
1013
|
else {
|
|
1086
1014
|
dict = (host ?? task)[field] = new Map();
|
|
1087
1015
|
}
|
|
1088
|
-
fiber = new $
|
|
1016
|
+
fiber = new $mol_wire_atom(key, task, host, ...args);
|
|
1089
1017
|
dict.set(key, fiber);
|
|
1090
1018
|
return fiber;
|
|
1091
1019
|
};
|
|
@@ -1096,7 +1024,7 @@ var $;
|
|
|
1096
1024
|
if (existen)
|
|
1097
1025
|
return existen;
|
|
1098
1026
|
const key = `${host?.[Symbol.toStringTag] ?? host}.${field}`;
|
|
1099
|
-
const fiber = new $
|
|
1027
|
+
const fiber = new $mol_wire_atom(key, task, host, ...args);
|
|
1100
1028
|
(host ?? task)[field] = fiber;
|
|
1101
1029
|
return fiber;
|
|
1102
1030
|
};
|
|
@@ -1160,13 +1088,85 @@ var $;
|
|
|
1160
1088
|
}
|
|
1161
1089
|
__decorate([
|
|
1162
1090
|
$mol_wire_method
|
|
1163
|
-
], $
|
|
1091
|
+
], $mol_wire_atom.prototype, "recall", null);
|
|
1164
1092
|
__decorate([
|
|
1165
1093
|
$mol_wire_method
|
|
1166
|
-
], $
|
|
1167
|
-
$.$
|
|
1094
|
+
], $mol_wire_atom.prototype, "once", null);
|
|
1095
|
+
$.$mol_wire_atom = $mol_wire_atom;
|
|
1168
1096
|
})($ || ($ = {}));
|
|
1169
|
-
//mol/wire/
|
|
1097
|
+
//mol/wire/atom/atom.ts
|
|
1098
|
+
;
|
|
1099
|
+
"use strict";
|
|
1100
|
+
var $;
|
|
1101
|
+
(function ($) {
|
|
1102
|
+
function $mol_wire_probe(task, next) {
|
|
1103
|
+
const warm = $mol_wire_fiber.warm;
|
|
1104
|
+
try {
|
|
1105
|
+
$mol_wire_fiber.warm = false;
|
|
1106
|
+
return task();
|
|
1107
|
+
}
|
|
1108
|
+
finally {
|
|
1109
|
+
$mol_wire_fiber.warm = warm;
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
$.$mol_wire_probe = $mol_wire_probe;
|
|
1113
|
+
})($ || ($ = {}));
|
|
1114
|
+
//mol/wire/probe/probe.ts
|
|
1115
|
+
;
|
|
1116
|
+
"use strict";
|
|
1117
|
+
var $;
|
|
1118
|
+
(function ($) {
|
|
1119
|
+
function $mol_wire_solid() {
|
|
1120
|
+
$mol_wire_auto().reap = nothing;
|
|
1121
|
+
}
|
|
1122
|
+
$.$mol_wire_solid = $mol_wire_solid;
|
|
1123
|
+
const nothing = () => { };
|
|
1124
|
+
})($ || ($ = {}));
|
|
1125
|
+
//mol/wire/solid/solid.ts
|
|
1126
|
+
;
|
|
1127
|
+
"use strict";
|
|
1128
|
+
var $;
|
|
1129
|
+
(function ($) {
|
|
1130
|
+
function $mol_wire_sync(obj) {
|
|
1131
|
+
return new Proxy(obj, {
|
|
1132
|
+
get(obj, field) {
|
|
1133
|
+
const val = obj[field];
|
|
1134
|
+
if (typeof val !== 'function')
|
|
1135
|
+
return val;
|
|
1136
|
+
const temp = $mol_wire_task.getter(val);
|
|
1137
|
+
return function $mol_wire_sync(...args) {
|
|
1138
|
+
const fiber = temp(obj, args);
|
|
1139
|
+
return fiber.sync();
|
|
1140
|
+
};
|
|
1141
|
+
}
|
|
1142
|
+
});
|
|
1143
|
+
}
|
|
1144
|
+
$.$mol_wire_sync = $mol_wire_sync;
|
|
1145
|
+
})($ || ($ = {}));
|
|
1146
|
+
//mol/wire/sync/sync.ts
|
|
1147
|
+
;
|
|
1148
|
+
"use strict";
|
|
1149
|
+
var $;
|
|
1150
|
+
(function ($) {
|
|
1151
|
+
function $mol_wire_async(obj) {
|
|
1152
|
+
return new Proxy(obj, {
|
|
1153
|
+
get(obj, field) {
|
|
1154
|
+
const val = obj[field];
|
|
1155
|
+
if (typeof val !== 'function')
|
|
1156
|
+
return val;
|
|
1157
|
+
let fiber;
|
|
1158
|
+
const temp = $mol_wire_task.getter(val);
|
|
1159
|
+
return function $mol_wire_async(...args) {
|
|
1160
|
+
fiber?.destructor();
|
|
1161
|
+
fiber = temp(obj, args);
|
|
1162
|
+
return fiber.async();
|
|
1163
|
+
};
|
|
1164
|
+
}
|
|
1165
|
+
});
|
|
1166
|
+
}
|
|
1167
|
+
$.$mol_wire_async = $mol_wire_async;
|
|
1168
|
+
})($ || ($ = {}));
|
|
1169
|
+
//mol/wire/async/async.ts
|
|
1170
1170
|
;
|
|
1171
1171
|
"use strict";
|
|
1172
1172
|
var $;
|
|
@@ -1192,11 +1192,11 @@ var $;
|
|
|
1192
1192
|
$.$mol_wire_mem = $mol_wire_mem;
|
|
1193
1193
|
function $mol_wire_mem_func(keys) {
|
|
1194
1194
|
return (func) => {
|
|
1195
|
-
const persist = $
|
|
1195
|
+
const persist = $mol_wire_atom.getter(func, keys);
|
|
1196
1196
|
const wrapper = function (...args) {
|
|
1197
1197
|
let atom = persist(this, args.slice(0, keys));
|
|
1198
1198
|
if (args.length <= keys || args[keys] === undefined) {
|
|
1199
|
-
if ($mol_wire_auto() instanceof $
|
|
1199
|
+
if ($mol_wire_auto() instanceof $mol_wire_task) {
|
|
1200
1200
|
return atom.once();
|
|
1201
1201
|
}
|
|
1202
1202
|
else {
|
|
@@ -1234,7 +1234,7 @@ var $;
|
|
|
1234
1234
|
if (!descr)
|
|
1235
1235
|
descr = Reflect.getOwnPropertyDescriptor(host, field);
|
|
1236
1236
|
const _get = descr?.get || $mol_const(descr?.value);
|
|
1237
|
-
const persist = $
|
|
1237
|
+
const persist = $mol_wire_atom.getter(_get, 0);
|
|
1238
1238
|
const _set = descr?.set || function (next) {
|
|
1239
1239
|
persist(this, []).put(next);
|
|
1240
1240
|
};
|
|
@@ -1245,7 +1245,7 @@ var $;
|
|
|
1245
1245
|
function get() {
|
|
1246
1246
|
return persist(this, []).sync();
|
|
1247
1247
|
}
|
|
1248
|
-
const temp = $
|
|
1248
|
+
const temp = $mol_wire_task.getter(_set);
|
|
1249
1249
|
function set(next) {
|
|
1250
1250
|
temp(this, [next]).sync();
|
|
1251
1251
|
}
|