mirror of
https://github.com/jaandrle/deka-dom-el
synced 2025-07-01 12:22:15 +02:00
⚡ Docs
This commit is contained in:
13
docs/components/examples/events/abortSignal.js
Normal file
13
docs/components/examples/events/abortSignal.js
Normal file
@ -0,0 +1,13 @@
|
||||
import { el, on } from "deka-dom-el";
|
||||
const log= mark=> console.log.bind(console, mark);
|
||||
|
||||
const abort_controller= new AbortController();
|
||||
const { signal }= abort_controller;
|
||||
|
||||
const button= el("button", "Test click");
|
||||
button.addEventListener("click", log("`addEventListener`"), { signal });
|
||||
on("click", log("`on`"), { signal })(button);
|
||||
|
||||
document.body.append(
|
||||
button, " ", el("button", { textContent: "Off", onclick: ()=> abort_controller.abort() })
|
||||
);
|
Reference in New Issue
Block a user