♻️ Improve removing signal listener from elements

This commit is contained in:
jaandrle committed 2023-10-14 16:20:54 +02:00
1 parent c20f5ae117
commit 39900dc85b
4 files changed
+263 -243

No files matched your search

+2 -6
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];