10-07-2020 10:47
10-07-2020 10:47
Is it possible to create a custom event and catch it? I tried the code below and the event doesn't seem to get fired.
let event = new Event("hello");
document.body.dispatchEvent(event);
...
document.addEventListener("hello", () => {
console.log("CAUGHT EVENT");
});
Best Answer11-16-2020 05:59
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
11-16-2020 05:59
Yes, it should be possible to use dispatchEvent. There's no body element though.
Best Answer11-29-2022 00:46
11-29-2022 00:46
Can you provide a minimal example of custom events please?