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

♻️ Improve removing signal listener from elements

This commit is contained in:
2023-10-14 16:18:11 +02:00
parent c20f5ae117
commit 39900dc85b
4 changed files with 263 additions and 243 deletions

View File

@ -18,13 +18,9 @@ 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){ this.value.splice(i, 1)[0]; },
[S.symbols.onclear](){
console.log("zde");
S.clear(...this.value);
},
remove(i){ this.value.splice(i, 1)[0]; }
});
console.log(todosS);
const name= "todoName";
const onsubmitAdd= on("submit", event=> {
const el= event.target.elements[name];