pseudo code

pull/4142/head
Pontus Lundin 6 years ago committed by GitHub
parent f2eb632bc9
commit 6ebffd2882
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -268,6 +268,9 @@ export function toggle_class(element, name, toggle) {
}
export function custom_event<T=any>(type: string, detail?: T) {
// is compile target customElement?
// is event not a Svelte event?
// use new CustomEvent with bubbles/composed = true for non, svelte event
const e: CustomEvent<T> = document.createEvent('CustomEvent');
e.initCustomEvent(type, false, false, detail);
return e;

Loading…
Cancel
Save