Skip to content

Instantly share code, notes, and snippets.

@SpenceDiNicolantonio
Created April 30, 2024 22:11
Show Gist options
  • Save SpenceDiNicolantonio/13359051749735107c8ea48d6c493f29 to your computer and use it in GitHub Desktop.
Save SpenceDiNicolantonio/13359051749735107c8ea48d6c493f29 to your computer and use it in GitHub Desktop.
Sop Propagation directive #svelte #typescript #directive
export default function stopPropagation(fn: (e: Event) => void) {
return function (this: (e: Event) => void, event: Event) {
event.stopPropagation();
fn.call(this, event);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment