diff options
| author | Guillermo Serrahima <dev@vylion.com> | 2026-02-19 12:18:34 +0100 |
|---|---|---|
| committer | Guillermo Serrahima <dev@vylion.com> | 2026-02-19 12:18:34 +0100 |
| commit | b8614b16e958cbacfff05a8e2f79f8e4410654b8 (patch) | |
| tree | 68d89f394ff5f34259e59af76cc4e6408a6e392a /frontend/src/counter.ts | |
| parent | f81aae44181222a2792d6a91c1506075969a81e8 (diff) | |
| download | llostre-b8614b16e958cbacfff05a8e2f79f8e4410654b8.tar.xz llostre-b8614b16e958cbacfff05a8e2f79f8e4410654b8.zip | |
added frontend (vanilla-ts with bun)
Diffstat (limited to 'frontend/src/counter.ts')
| -rw-r--r-- | frontend/src/counter.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/frontend/src/counter.ts b/frontend/src/counter.ts new file mode 100644 index 0000000..09e5afd --- /dev/null +++ b/frontend/src/counter.ts @@ -0,0 +1,9 @@ +export function setupCounter(element: HTMLButtonElement) { + let counter = 0 + const setCounter = (count: number) => { + counter = count + element.innerHTML = `count is ${counter}` + } + element.addEventListener('click', () => setCounter(counter + 1)) + setCounter(0) +} |
