From 33b54348cc17fdcaeeb06c36526893537e4ed4ed Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:57:18 +0100 Subject: [PATCH] simplify --- .../internal/client/dom/elements/attributes.js | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/packages/svelte/src/internal/client/dom/elements/attributes.js b/packages/svelte/src/internal/client/dom/elements/attributes.js index bfb7e15a3f0f..d927af543ff2 100644 --- a/packages/svelte/src/internal/client/dom/elements/attributes.js +++ b/packages/svelte/src/internal/client/dom/elements/attributes.js @@ -209,8 +209,6 @@ export function set_attributes( // @ts-expect-error var attributes = /** @type {Record} **/ (element.__attributes ??= {}); - /** @type {Array<[string, any, () => void]>} */ - var events = []; // since key is captured we use const for (const key in next) { @@ -277,15 +275,7 @@ export function set_attributes( current[key].call(this, evt); } - if (!prev) { - events.push([ - key, - value, - () => (current[event_handle_key] = create_event(event_name, element, handle, opts)) - ]); - } else { - current[event_handle_key] = create_event(event_name, element, handle, opts); - } + current[event_handle_key] = create_event(event_name, element, handle, opts); } else { // @ts-ignore element[`__${event_name}`] = value; @@ -325,12 +315,6 @@ export function set_attributes( } } - for (const [key, value, evt] of events) { - if (current[key] === value) { - evt(); - } - } - return current; }