pinafore/routes/_components/timeline/LazyTimeline.html
Nolan Lawson 8d5690d63d
remove get() with string from Svelte calls (#169)
* remove get() with string pt 1

* remove get() with string pt 2

* fix typo

* fix some null exceptions in get()

* fixup code style
2018-04-19 09:37:05 -07:00

30 lines
763 B
HTML

<div class="lazy-timeline">
{{#await importTimeline}}
{{then constructor}}
<:Component {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>