mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
Linting
This commit is contained in:
parent
9e85db1ab6
commit
21f0964491
@ -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>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user