MCPcopy
hub / github.com/sveltejs/svelte / self

Function self

packages/svelte/src/internal/client/dom/legacy/event-modifiers.js:27–36  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

25 * @returns {(event: Event, ...args: unknown[]) => void}
26 */
27export function self(fn) {
28 return function (...args) {
29 var event = /** @type {Event} */ (args[0]);
30 // @ts-ignore
31 if (event.target === this) {
32 // @ts-ignore
33 fn?.apply(this, args);
34 }
35 };
36}
37
38/**
39 * Substitute for the `stopPropagation` event modifier

Callers

nothing calls this directly

Calls 1

applyMethod · 0.45

Tested by

no test coverage detected