Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinpalkovic committed May 27, 2024
1 parent 9e85db1 commit 21f0964
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/renderers/svelte/src/components/SlotDecorator.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
if (on && svelteVersion < 5) {
// Attach Svelte event listeners in Svelte v4
// In Svelte v5 this is not possible anymore as instances are no longer classes with $on() properties, so it will be a no-op
onMount(() => {
onMount(() => {
Object.entries(on).forEach(([eventName, eventCallback]) => {
// instance can be undefined if a decorator doesn't have <slot/>
const inst = instance ?? decoratorInstance;
inst?.$on?.(eventName, eventCallback)
});
});
});
}
</script>
Expand Down

0 comments on commit 21f0964

Please sign in to comment.