1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2024-11-21 23:39:37 +01:00

🐛 clear todos on remove (todosComponent example)

This commit is contained in:
Jan Andrle 2023-10-14 18:08:07 +02:00
parent 39900dc85b
commit 7d4cc29174
Signed by: jaandrle
GPG Key ID: B3A25AED155AFFAB

View File

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