LeRobot.js / src /counter.ts
NERDDISCO's picture
first commit
540cfa6
raw
history blame
274 Bytes
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)
}