mirror of
https://github.com/jaandrle/deka-dom-el
synced 2025-04-03 04:25:53 +02:00
🐛 coumputed signal
This commit is contained in:
parent
6c4ddd655f
commit
7ec50e1660
2
dist/dde-with-signals.js
vendored
2
dist/dde-with-signals.js
vendored
@ -718,7 +718,7 @@ function signal(value, actions) {
|
|||||||
const [origin, ...deps_old] = deps.get(contextReWatch);
|
const [origin, ...deps_old] = deps.get(contextReWatch);
|
||||||
deps.set(contextReWatch, /* @__PURE__ */ new Set([origin]));
|
deps.set(contextReWatch, /* @__PURE__ */ new Set([origin]));
|
||||||
stack_watch.push(contextReWatch);
|
stack_watch.push(contextReWatch);
|
||||||
write(out, value.get());
|
write(out, value());
|
||||||
stack_watch.pop();
|
stack_watch.pop();
|
||||||
if (!deps_old.length) return;
|
if (!deps_old.length) return;
|
||||||
const deps_curr = deps.get(contextReWatch);
|
const deps_curr = deps.get(contextReWatch);
|
||||||
|
9
dist/esm-with-signals.d.ts
vendored
9
dist/esm-with-signals.d.ts
vendored
@ -52,9 +52,12 @@ type IsReadonly<T, K extends keyof T> =
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
type ElementAttributes<T extends SupportedElement>= Partial<{
|
type ElementAttributes<T extends SupportedElement>= Partial<{
|
||||||
[K in keyof _fromElsInterfaces<T>]: IsReadonly<_fromElsInterfaces<T>, K> extends false
|
[K in keyof _fromElsInterfaces<T>]:
|
||||||
? _fromElsInterfaces<T>[K] | ddeSignal<_fromElsInterfaces<T>[K]>
|
_fromElsInterfaces<T>[K] extends ((...p: any[])=> any)
|
||||||
: ddeStringable
|
? _fromElsInterfaces<T>[K] | ((...p: Parameters<_fromElsInterfaces<T>[K]>)=> ddeSignal<ReturnType<_fromElsInterfaces<T>[K]>>)
|
||||||
|
: (IsReadonly<_fromElsInterfaces<T>, K> extends false
|
||||||
|
? _fromElsInterfaces<T>[K] | ddeSignal<_fromElsInterfaces<T>[K]>
|
||||||
|
: ddeStringable)
|
||||||
} & AttrsModified> & Record<string, any>;
|
} & AttrsModified> & Record<string, any>;
|
||||||
export function classListDeclarative<El extends SupportedElement>(
|
export function classListDeclarative<El extends SupportedElement>(
|
||||||
element: El,
|
element: El,
|
||||||
|
2
dist/esm-with-signals.js
vendored
2
dist/esm-with-signals.js
vendored
@ -716,7 +716,7 @@ function signal(value, actions) {
|
|||||||
const [origin, ...deps_old] = deps.get(contextReWatch);
|
const [origin, ...deps_old] = deps.get(contextReWatch);
|
||||||
deps.set(contextReWatch, /* @__PURE__ */ new Set([origin]));
|
deps.set(contextReWatch, /* @__PURE__ */ new Set([origin]));
|
||||||
stack_watch.push(contextReWatch);
|
stack_watch.push(contextReWatch);
|
||||||
write(out, value.get());
|
write(out, value());
|
||||||
stack_watch.pop();
|
stack_watch.pop();
|
||||||
if (!deps_old.length) return;
|
if (!deps_old.length) return;
|
||||||
const deps_curr = deps.get(contextReWatch);
|
const deps_curr = deps.get(contextReWatch);
|
||||||
|
9
dist/esm.d.ts
vendored
9
dist/esm.d.ts
vendored
@ -52,9 +52,12 @@ type IsReadonly<T, K extends keyof T> =
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
type ElementAttributes<T extends SupportedElement>= Partial<{
|
type ElementAttributes<T extends SupportedElement>= Partial<{
|
||||||
[K in keyof _fromElsInterfaces<T>]: IsReadonly<_fromElsInterfaces<T>, K> extends false
|
[K in keyof _fromElsInterfaces<T>]:
|
||||||
? _fromElsInterfaces<T>[K] | ddeSignal<_fromElsInterfaces<T>[K]>
|
_fromElsInterfaces<T>[K] extends ((...p: any[])=> any)
|
||||||
: ddeStringable
|
? _fromElsInterfaces<T>[K] | ((...p: Parameters<_fromElsInterfaces<T>[K]>)=> ddeSignal<ReturnType<_fromElsInterfaces<T>[K]>>)
|
||||||
|
: (IsReadonly<_fromElsInterfaces<T>, K> extends false
|
||||||
|
? _fromElsInterfaces<T>[K] | ddeSignal<_fromElsInterfaces<T>[K]>
|
||||||
|
: ddeStringable)
|
||||||
} & AttrsModified> & Record<string, any>;
|
} & AttrsModified> & Record<string, any>;
|
||||||
export function classListDeclarative<El extends SupportedElement>(
|
export function classListDeclarative<El extends SupportedElement>(
|
||||||
element: El,
|
element: El,
|
||||||
|
@ -62,7 +62,7 @@ export function signal(value, actions){
|
|||||||
deps.set(contextReWatch, new Set([ origin ]));
|
deps.set(contextReWatch, new Set([ origin ]));
|
||||||
|
|
||||||
stack_watch.push(contextReWatch);
|
stack_watch.push(contextReWatch);
|
||||||
write(out, value.get());
|
write(out, value());
|
||||||
stack_watch.pop();
|
stack_watch.pop();
|
||||||
|
|
||||||
if(!deps_old.length) return;
|
if(!deps_old.length) return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user