Comparing version 0.1.12 to 0.1.13
{ | ||
"name": "webdetta", | ||
"version": "0.1.12", | ||
"version": "0.1.13", | ||
"author": "Fedot Kriutchenko <fodyadev@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "", |
@@ -74,16 +74,7 @@ import Builder from '../common/builder.js'; | ||
return func.component ??= function (...args) { | ||
const onTurnOff = new Set(); | ||
const owner = { | ||
turnOff: () => { for (const h of onTurnOff) h(); }, | ||
onTurnOff: (h) => onTurnOff.add(h) | ||
}; | ||
const elem = Element.from(r.effect(func.bind(this, ...args), owner, false)); | ||
const dom = !Builder.isBuilder(elem) ? elem : ( | ||
tmpl ??= Builder.launch(elem, null), | ||
Builder.launch(elem, tmpl.cloneNode(true)) | ||
); | ||
dom.turnOff = owner.turnOff; | ||
return dom; | ||
const elem = Element.from(func(...args)); | ||
if (!Builder.isBuilder(elem)) return elem; | ||
tmpl ??= Builder.launch(elem, null); | ||
return Builder.launch(elem, tmpl.cloneNode(true)); | ||
} | ||
} |
import Builder from '../common/builder.js'; | ||
import { Context } from '../common/context.js'; | ||
import { callFn, unwrapFn, once } from '../common/utils.js'; | ||
import { callFn, unwrapFn } from '../common/utils.js'; | ||
import { r } from '../reactivity/index.js'; | ||
import { ref } from './operators.js'; | ||
import { Element, Component } from './dom.js'; | ||
@@ -7,0 +6,0 @@ |
3
127530
3766