aboutsummaryrefslogtreecommitdiffstats
path: root/frontend-vanilla/src/counter.ts
diff options
context:
space:
mode:
authorAdam Mathes <adam@adammathes.com>2026-02-15 17:30:34 -0800
committerAdam Mathes <adam@adammathes.com>2026-02-15 17:30:34 -0800
commit90c1a68d6478138f538094fc83e48da8ddd21fa0 (patch)
tree90c5e03ec49bb0790ca849f6dac09786cd93bce3 /frontend-vanilla/src/counter.ts
parent7ceec2469ecb047ed8f9c8e2149323d8500773e2 (diff)
downloadneko-90c1a68d6478138f538094fc83e48da8ddd21fa0.tar.gz
neko-90c1a68d6478138f538094fc83e48da8ddd21fa0.tar.bz2
neko-90c1a68d6478138f538094fc83e48da8ddd21fa0.zip
Scaffold Vanilla JS Frontend (v3): Create directory, update Makefile/web.go, embed dist/v3
Diffstat (limited to 'frontend-vanilla/src/counter.ts')
-rw-r--r--frontend-vanilla/src/counter.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/frontend-vanilla/src/counter.ts b/frontend-vanilla/src/counter.ts
new file mode 100644
index 0000000..09e5afd
--- /dev/null
+++ b/frontend-vanilla/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)
+}