This repository has been archived on 2020-10-16. You can view files and clone it, but cannot push or open issues or pull requests.
counter/frontend/components/counter-down-btn/counter-down-btn.js

14 lines
325 B
JavaScript

import "./counter-down-btn.pcss";
import { sendDecrement } from "client/counter";
window.addEventListener("DOMContentLoaded", () => {
const btn = document.querySelector(".counter-down-btn");
if (btn) {
btn.addEventListener("click", (event) => {
event.preventDefault();
sendDecrement(1);
});
}
});