kaisermann / svelte-loadable

Dynamically load a svelte component
MIT License
320 stars 13 forks source link

Dispatch custom events from loaded components #46

Open nine-2-five opened 2 years ago

nine-2-five commented 2 years ago

Hi, any way to connect createEventDispatcher in inner/loaded component to the outer world?

I have this in my Options.svelte component:

<Loadable loader={() => import('./Select.svelte')} {element} on:selectionMade={selectionMade}></Loadable>

In this case Select.svelte dispatches selection event, and I'd like to handle it in Options.svelte, but the Loadable doesn't attach the handler to the inner/loaded Select.svelte.