1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-07-01 12:22:15 +02:00

🚀 Remove signal listeners automatically (fixes #20)

This commit is contained in:
2023-10-13 20:57:21 +02:00
parent 4c571354c4
commit 9f57913f8d
10 changed files with 494 additions and 414 deletions

View File

@ -18,7 +18,7 @@ const className= style.host(todosComponent).css`
export function todosComponent({ todos= [ "Task A" ] }= {}){
const todosS= S(todos.map(t=> S(t)), {
add(v){ this.value.push(S(v)); },
remove(i){ S.clear(this.value.splice(i, 1)[0]); },
remove(i){ this.value.splice(i, 1)[0]; },
[S.symbols.onclear](){ S.clear(...this.value); },
});
const name= "todoName";

View File

@ -2,12 +2,11 @@ import * as dde_dom from "../index.js";
export * from "../index.js";
import * as dde_s from "../signals.js";
export * from "../signals.js";
// import { empty, namespace, on, dispatch } from "../index.js";
// import "../dist/dde-with-signals.js";
// Object.assign(globalThis, dde);
// import { el, on, off, S } from "../dist/esm-with-signals.js";
export const style= createStyle();
Object.assign(globalThis, dde_dom, dde_s);
//import * as dde_dom from "../dist/esm-with-signals.js";
//export * from "../dist/esm-with-signals.js";
//Object.assign(globalThis, dde_dom);
export const style= createStyle();
function createStyle(){
const element= dde_dom.el("style");