kaisermann / svelte-loadable

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

Feature: Support for loading components by promise #41

Open duruer opened 3 years ago

duruer commented 3 years ago

Hi, if you do like this

<Loadable loader="{import('./Test.svelte')}" delay="{delay}">
  <div slot="success" let:component>
    <svelte:component this="{component}" {...params} />
  </div>
</Loadable>

It won't load the component and will give error like; component.then is not a function Maybe you can detect is it a promise in loader and if it is, it can await it to load?