pull/4527/head
hontas 6 years ago
parent 7d9ff14099
commit 0245239eaa

@ -273,9 +273,6 @@ export function toggle_class(element, name, toggle) {
} }
export function custom_event<T=any>(type: string, detail?: T) { 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'); const e: CustomEvent<T> = document.createEvent('CustomEvent');
e.initCustomEvent(type, false, false, detail); e.initCustomEvent(type, false, false, detail);
return e; return e;

@ -28,8 +28,6 @@ export function onDestroy(fn) {
} }
export function createEventDispatcher() { export function createEventDispatcher() {
// is compile target customElement?
// always dispatch!
const component = get_current_component(); const component = get_current_component();
return (type: string, detail?: any) => { return (type: string, detail?: any) => {

Loading…
Cancel
Save