DuyTa's picture
Upload folder using huggingface_hub
bc20498 verified
raw
history blame
478 Bytes
import { createEventDispatcher } from "svelte";
export function createDispatcher() {
const dispatch = createEventDispatcher();
return (e) => {
const { originalEvent } = e.detail;
const { cancelable } = e;
const type = originalEvent.type;
const shouldContinue = dispatch(type, { originalEvent, currentTarget: originalEvent.currentTarget }, { cancelable });
if (!shouldContinue) {
e.preventDefault();
}
};
}