1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2024-11-24 01:29:36 +01:00
deka-dom-el/docs/components/mnemonic/events-init.js

25 lines
1009 B
JavaScript
Raw Normal View History

2023-11-29 18:25:21 +01:00
import { el } from "deka-dom-el";
import { mnemonicUl } from "../mnemonicUl.html.js";
export function mnemonic(){
return mnemonicUl().append(
el("li").append(
2024-11-22 16:26:42 +01:00
el("code", "on(<event>, <listener>[, <options>])(<element>)"),
" — just ", el("code", "<element>.addEventListener(<event>, <listener>[, <options>])")
2023-11-29 18:25:21 +01:00
),
el("li").append(
2024-11-22 16:26:42 +01:00
el("code", "on.<live-cycle>(<event>, <listener>[, <options>])(<element>)"),
" — corresponds to custom elemnets callbacks ", el("code", "<live-cycle>Callback(...){...}"),
2023-11-29 18:25:21 +01:00
". To connect to custom element see following page, else it is simulated by MutationObserver."
),
el("li").append(
2024-11-22 16:26:42 +01:00
el("code", "dispatchEvent(<event>[, <options>])(element)"),
" — just ", el("code", "<element>.dispatchEvent(new Event(<event>[, <options>]))")
2023-11-29 18:25:21 +01:00
),
el("li").append(
2024-11-22 16:26:42 +01:00
el("code", "dispatchEvent(<event>[, <options>])(element, detail)"),
" — just ", el("code", "<element>.dispatchEvent(new CustomEvent(<event>, { detail, ...<options> }))")
2023-11-29 18:25:21 +01:00
),
);
}