Skip to content

Commit

Permalink
refactor(examples): use event consts
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Dec 15, 2019
1 parent 89f9dbb commit 1c8073b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/hdom-elm/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h3>Hotkeys</h3>
<div class="mt3">
<a
class="link"
href="https://github.com/thi-ng/umbrella/tree/master/examples/hdom-elm"
href="https://github.com/thi-ng/umbrella/tree/develop/examples/hdom-elm"
>Source code</a
>
</div>
Expand Down
8 changes: 4 additions & 4 deletions examples/hdom-elm/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1c8073b

Please sign in to comment.