From: Scott Worley Date: Tue, 25 Jan 2022 23:53:04 +0000 (-0800) Subject: Writes go through the Log X-Git-Url: http://git.scottworley.com/vopamoi/commitdiff_plain/262705dd315ec4bf7088cc3ec9013dc32f3e3bd3?ds=sidebyside Writes go through the Log --- diff --git a/vopamoi.ts b/vopamoi.ts index a3f6ce4..505781d 100644 --- a/vopamoi.ts +++ b/vopamoi.ts @@ -22,6 +22,12 @@ const Model = { }, }; +const Log = { + addTask: function (description: string) { + Model.addTask(description); + }, +}; + function handleKey(event: any) { if (event.target.tagName !== "INPUT") { if (event.key == "j") Model.moveCursor(1); @@ -35,7 +41,7 @@ function handleKey(event: any) { function browserCreateTask(form: any) { if (form.taskName.value) { - Model.addTask(form.taskName.value); + Log.addTask(form.taskName.value); } form.taskName.value = ""; return false;