mono-jsx 0.8.0 → 0.8.1
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/dom/jsx-runtime.mjs +5 -5
- package/jsx-runtime.mjs +1 -1
- package/package.json +1 -1
package/dom/jsx-runtime.mjs
CHANGED
|
@@ -71,7 +71,7 @@ var Signal = class extends Reactive {
|
|
|
71
71
|
onAbort(abortSignal, this.#scope[$watch](this.#key, callback));
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
|
-
var
|
|
74
|
+
var Computed = class extends Reactive {
|
|
75
75
|
#scope;
|
|
76
76
|
#compute;
|
|
77
77
|
#deps;
|
|
@@ -202,7 +202,7 @@ var createScope = (slots, abortSignal) => {
|
|
|
202
202
|
throw new TypeError("setter is not allowed");
|
|
203
203
|
}
|
|
204
204
|
if (get) {
|
|
205
|
-
target[key2] = new
|
|
205
|
+
target[key2] = new Computed(receiver, get);
|
|
206
206
|
} else {
|
|
207
207
|
if (key2 === "effect") {
|
|
208
208
|
if (isFunction(value)) {
|
|
@@ -216,8 +216,8 @@ var createScope = (slots, abortSignal) => {
|
|
|
216
216
|
return receiver;
|
|
217
217
|
};
|
|
218
218
|
case "$":
|
|
219
|
-
case "
|
|
220
|
-
return (fn) => new
|
|
219
|
+
case "computed":
|
|
220
|
+
return (fn) => new Computed(receiver, fn);
|
|
221
221
|
case "effect":
|
|
222
222
|
return (callback) => {
|
|
223
223
|
queueMicrotask(() => {
|
|
@@ -384,7 +384,7 @@ var render = (scope, child, root, abortSignal) => {
|
|
|
384
384
|
}, abortSignal);
|
|
385
385
|
onAbort(abortSignal, () => ac?.abort());
|
|
386
386
|
} else {
|
|
387
|
-
console.warn("[mono-jsx] <" + tag + "> The `when` prop is not a signal/
|
|
387
|
+
console.warn("[mono-jsx] <" + tag + "> The `when` prop is not a signal/computed.");
|
|
388
388
|
if (when) {
|
|
389
389
|
renderChildren(scope, children, root, abortSignal);
|
|
390
390
|
}
|
package/jsx-runtime.mjs
CHANGED