Utils
Event Dispatcher
dispatch(host: Element, eventType: string, [options]): Booleanimport { html, dispatch } from 'hybrids';
function change(host) {
host.value += 1;
// Trigger not bubbling `change` custom event
dispatch(host, 'change', { detail: host.value });
}
const MyElement = {
value: 0,
render: ({ value }) => html`
<button onclick="${change}">You clicked me ${value} times!</button>
`,
};Last updated
Was this helpful?