2018-01-19 09:51:51 +01:00
|
|
|
<div class="lazy-timeline">
|
2018-05-02 02:05:36 +02:00
|
|
|
{#await importTimeline}
|
2018-04-30 07:13:41 +02:00
|
|
|
<!-- awaiting promise -->
|
2018-05-02 02:05:36 +02:00
|
|
|
{:then constructor}
|
|
|
|
<svelte:component this={constructor} {timeline} />
|
|
|
|
{:catch error}
|
|
|
|
<div>Component failed to load. Try refreshing! {error}</div>
|
|
|
|
{/await}
|
2018-01-15 08:24:27 +01:00
|
|
|
</div>
|
|
|
|
<style>
|
2018-01-19 09:51:51 +01:00
|
|
|
.lazy-timeline {
|
2018-01-15 08:24:27 +01:00
|
|
|
width: 100%;
|
2018-01-19 09:51:51 +01:00
|
|
|
}
|
2018-01-15 08:24:27 +01:00
|
|
|
</style>
|
|
|
|
<script>
|
2018-01-28 01:35:44 +01:00
|
|
|
import { importTimeline } from '../../_utils/asyncModules'
|
2018-01-28 22:09:39 +01:00
|
|
|
import { store } from '../../_store/store'
|
2018-01-15 08:24:27 +01:00
|
|
|
|
|
|
|
export default {
|
2018-04-20 06:38:01 +02:00
|
|
|
oncreate () {
|
2018-04-19 18:37:05 +02:00
|
|
|
let { currentInstance } = this.store.get()
|
|
|
|
let { timeline } = this.get()
|
2018-08-30 06:42:57 +02:00
|
|
|
this.store.set({ currentTimeline: timeline })
|
|
|
|
this.store.setForTimeline(currentInstance, timeline, { runningUpdate: false })
|
2018-01-27 19:46:52 +01:00
|
|
|
},
|
|
|
|
store: () => store,
|
2018-01-15 08:24:27 +01:00
|
|
|
data: () => ({
|
2018-03-13 06:13:51 +01:00
|
|
|
importTimeline: importTimeline()
|
2018-01-31 07:21:31 +01:00
|
|
|
})
|
2018-01-15 08:24:27 +01:00
|
|
|
}
|
|
|
|
</script>
|