From 1c8073b3929c142fee2d07da309c2b0bf84d7c4f Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Sun, 15 Dec 2019 14:28:21 +0000 Subject: [PATCH] refactor(examples): use event consts --- examples/hdom-elm/index.html | 2 +- examples/hdom-elm/src/index.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/hdom-elm/index.html b/examples/hdom-elm/index.html index 04cff08463..f0a41b5569 100644 --- a/examples/hdom-elm/index.html +++ b/examples/hdom-elm/index.html @@ -31,7 +31,7 @@

Hotkeys

Source code
diff --git a/examples/hdom-elm/src/index.ts b/examples/hdom-elm/src/index.ts index d76477f53a..8aa45d2b71 100644 --- a/examples/hdom-elm/src/index.ts +++ b/examples/hdom-elm/src/index.ts @@ -16,17 +16,17 @@ mount( // update / event processor (event, model) => { switch (event[0]) { - case "inc": + case INC: return updateInT(model, ["value"], (x) => Math.min(x + event[1], 100) ); - case "dec": + case DEC: return updateInT(model, ["value"], (x) => Math.max(x - event[1], 0) ); - case "rnd": + case RANDOM: return setInT(model, ["value"], (Math.random() * 100) | 0); - case "defer": + case DEFER: setTimeout(() => event[1](), event[2]); break; default: