Saving state before severe refactoring (to support a proper update-loop and future extensibility)
This commit is contained in:
@@ -28,7 +28,9 @@ export class MyTodo extends CustomElement{
|
||||
<todo-item
|
||||
model={ item.id }
|
||||
checked={( item.checked )}
|
||||
>{ item.text }</todo-item>
|
||||
>
|
||||
{ item.text }
|
||||
</todo-item>
|
||||
)}
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
@@ -28,10 +28,12 @@ export class TodoItem extends CustomElement{
|
||||
handleChange = ()=>{
|
||||
this.dispatchEvent(new CustomEvent('check', {
|
||||
detail: (this.checked=!this.checked),
|
||||
bubbles: true
|
||||
}));
|
||||
};
|
||||
handleClick = ()=>{
|
||||
this.dispatchEvent(new CustomEvent('remove', {
|
||||
bubbles: true
|
||||
}));
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user