pinafore/routes/_components/timeline/LazyTimeline.html
greenkeeper[bot] 8dbc1b0503 Update standard to the latest version 🚀 (#519)
* chore(package): update standard to version 12.0.0

* package lock update

* fix eslint
2018-08-29 21:42:57 -07:00

31 lines
802 B
HTML

<div class="lazy-timeline">
{#await importTimeline}
<!-- awaiting promise -->
{:then constructor}
<svelte:component this={constructor} {timeline} />
{:catch error}
<div>Component failed to load. Try refreshing! {error}</div>
{/await}
</div>
<style>
.lazy-timeline {
width: 100%;
}
</style>
<script>
import { importTimeline } from '../../_utils/asyncModules'
import { store } from '../../_store/store'
export default {
oncreate () {
let { currentInstance } = this.store.get()
let { timeline } = this.get()
this.store.set({ currentTimeline: timeline })
this.store.setForTimeline(currentInstance, timeline, { runningUpdate: false })
},
store: () => store,
data: () => ({
importTimeline: importTimeline()
})
}
</script>