Skip to content

Commit 33b5434

Browse files
authored
simplify
1 parent d50c994 commit 33b5434

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

packages/svelte/src/internal/client/dom/elements/attributes.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,6 @@ export function set_attributes(
209209

210210
// @ts-expect-error
211211
var attributes = /** @type {Record<string, unknown>} **/ (element.__attributes ??= {});
212-
/** @type {Array<[string, any, () => void]>} */
213-
var events = [];
214212

215213
// since key is captured we use const
216214
for (const key in next) {
@@ -277,15 +275,7 @@ export function set_attributes(
277275
current[key].call(this, evt);
278276
}
279277

280-
if (!prev) {
281-
events.push([
282-
key,
283-
value,
284-
() => (current[event_handle_key] = create_event(event_name, element, handle, opts))
285-
]);
286-
} else {
287-
current[event_handle_key] = create_event(event_name, element, handle, opts);
288-
}
278+
current[event_handle_key] = create_event(event_name, element, handle, opts);
289279
} else {
290280
// @ts-ignore
291281
element[`__${event_name}`] = value;
@@ -325,12 +315,6 @@ export function set_attributes(
325315
}
326316
}
327317

328-
for (const [key, value, evt] of events) {
329-
if (current[key] === value) {
330-
evt();
331-
}
332-
}
333-
334318
return current;
335319
}
336320

0 commit comments

Comments
 (0)