|
|
@ -28,6 +28,8 @@ 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) => {
|
|
|
@ -61,4 +63,4 @@ export function bubble(component, event) {
|
|
|
|
if (callbacks) {
|
|
|
|
if (callbacks) {
|
|
|
|
callbacks.slice().forEach(fn => fn(event));
|
|
|
|
callbacks.slice().forEach(fn => fn(event));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|