Skip to content

Commit

Permalink
pseudo code
Browse files Browse the repository at this point in the history
  • Loading branch information
hontas authored Dec 18, 2019
1 parent f2eb632 commit 6ebffd2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/runtime/internal/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -307,4 +310,4 @@ export class HtmlTag {
d() {
this.n.forEach(detach);
}
}
}

0 comments on commit 6ebffd2

Please sign in to comment.