mirror of
https://github.com/jaandrle/deka-dom-el
synced 2024-11-22 07:49:38 +01:00
🐛 clear todos on remove (todosComponent example)
This commit is contained in:
parent
39900dc85b
commit
7d4cc29174
@ -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";
|
||||||
|
Loading…
Reference in New Issue
Block a user