mirror of
https://github.com/nvms/soma3.git
synced 2025-12-13 14:40:52 +00:00
k
This commit is contained in:
parent
4d71b03402
commit
e0f4945b1b
@ -14,7 +14,7 @@ var isElement = (node) => {
|
||||
return node.nodeType === Node.ELEMENT_NODE;
|
||||
};
|
||||
function isObject(value) {
|
||||
return value !== null && typeof value === "object";
|
||||
return value !== null && typeof value === "object" && !isArray(value);
|
||||
}
|
||||
function isArray(value) {
|
||||
return Array.isArray(value);
|
||||
@ -667,7 +667,7 @@ function trigger(target, key) {
|
||||
});
|
||||
scheduled.forEach(run);
|
||||
}
|
||||
function stop2(effect2) {
|
||||
function stop(effect2) {
|
||||
if (effect2.active) cleanup(effect2);
|
||||
effect2.active = false;
|
||||
}
|
||||
@ -712,11 +712,11 @@ function effect(handler, opts = {}) {
|
||||
start(newEffect);
|
||||
},
|
||||
stop: () => {
|
||||
stop2(newEffect);
|
||||
stop(newEffect);
|
||||
},
|
||||
toggle: () => {
|
||||
if (newEffect.active) {
|
||||
stop2(newEffect);
|
||||
stop(newEffect);
|
||||
} else {
|
||||
start(newEffect);
|
||||
}
|
||||
@ -1092,7 +1092,7 @@ var Block = class {
|
||||
this.context.blocks.forEach((block) => {
|
||||
block.teardown();
|
||||
});
|
||||
this.context.effects.forEach(stop);
|
||||
this.context.effects.forEach((e) => e.stop());
|
||||
}
|
||||
};
|
||||
function isComponent(element, context) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -354,7 +354,7 @@ app.mount(main, "#app");
|
||||
// </div>
|
||||
// `,
|
||||
// main() {
|
||||
// const colors = reactive(["red", "green"]);
|
||||
// const colors = reactive(["red", "orange"]);
|
||||
// return { colors };
|
||||
// },
|
||||
// };
|
||||
|
||||
@ -19,7 +19,7 @@ export const isElement = (node: Node): node is Element => {
|
||||
};
|
||||
|
||||
export function isObject(value: any): value is object {
|
||||
return value !== null && typeof value === "object";
|
||||
return value !== null && typeof value === "object" && !isArray(value);
|
||||
}
|
||||
|
||||
export function isArray(value: any): value is any[] {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user