Skip to content

Instantly share code, notes, and snippets.

View natxoski's full-sized avatar

Iggy natxoski

View GitHub Profile
@natxoski
natxoski / Loader.svelte
Last active March 11, 2020 01:35
Svelte Components Dynamic Import
<script>
export let templatePath;
let module;
if (!!templatePath && templatePath != "") {
import(templatePath)
.then(m => {
module = m.default;
return;
})
.catch(err => console.log(err));