update()

in resources/todomvc/vanilla-examples/javascript-web-components/src/components/todo-item/todo-item.component.js [54:72]


    update(...args) {
        args.forEach((argument) => {
            switch (argument) {
                case "itemid":
                    if (this.itemid !== undefined)
                        this.item.id = `todo-item-${this.itemid}`;
                    break;
                case "itemtitle":
                    if (this.itemtitle !== undefined) {
                        this.todoText.textContent = this.itemtitle;
                        this.editInput.value = this.itemtitle;
                    }
                    break;
                case "itemcompleted":
                    this.toggleInput.checked = this.itemcompleted === "true" ? true : false;
                    break;
            }
        });
    }