remove unnecessary sveltejs/svelte#1354 workarounds (#269)

This commit is contained in:
Nolan Lawson 2018-05-04 20:09:20 -07:00 committed by GitHub
parent 833afc59c0
commit a88fb70542
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 9 additions and 13 deletions

View file

@ -60,14 +60,14 @@
// perf improves for input responsiveness
this.observe('composeSelectionStart', () => {
scheduleIdleTask(() => {
let { composeSelectionStart } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
let { composeSelectionStart } = this.get()
this.set({composeSelectionStartDeferred: composeSelectionStart})
})
})
this.observe('composeFocused', (composeFocused) => {
let updateFocusedState = () => {
scheduleIdleTask(() => {
let { composeFocused } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
let { composeFocused } = this.get()
this.set({composeFocusedDeferred: composeFocused})
})
}

View file

@ -32,7 +32,7 @@
this.observe('lengthAsFraction', () => {
scheduleIdleTask(() => {
mark('set lengthAsFractionDeferred')
let { lengthAsFraction } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
let { lengthAsFraction } = this.get()
this.set({lengthAsFractionDeferred: lengthAsFraction})
stop('set lengthAsFractionDeferred')
requestAnimationFrame(() => this.set({shouldAnimate: true}))

View file

@ -30,7 +30,7 @@
this.observe('lengthToDisplay', () => {
scheduleIdleTask(() => {
mark('set lengthToDisplayDeferred')
let { lengthToDisplay } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
let { lengthToDisplay } = this.get()
this.set({lengthToDisplayDeferred: lengthToDisplay})
stop('set lengthToDisplayDeferred')
})

View file

@ -27,7 +27,7 @@
// unrender lazily; it's not a critical UI task
scheduleIdleTask(() => {
mark('unrender')
let { isIntersecting } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
let { isIntersecting } = this.get()
if (!isIntersecting) {
this.set({hide: true})
}

View file

@ -17,7 +17,7 @@
export default {
async oncreate () {
let { makeProps, key } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
let { makeProps, key } = this.get()
if (makeProps) {
let props = await makeProps(key)
mark('PseudoVirtualListLazyItem set props')

View file

@ -169,11 +169,7 @@
this.set({scrollTop: scrollTop})
},
onScrollToBottom () {
let state = this.store.get()
if (!state) {
return // https://github.com/sveltejs/svelte/issues/1354
}
let { timelineType } = state
let { timelineType } = this.store.get()
let { timelineInitialized, runningUpdate } = this.store.get()
if (!timelineInitialized ||
runningUpdate ||
@ -200,7 +196,7 @@
let { currentInstance } = this.store.get()
let { timeline } = this.get()
let handleItemIdsToAdd = () => {
let { itemIdsToAdd } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
let { itemIdsToAdd } = this.get()
if (!itemIdsToAdd || !itemIdsToAdd.length) {
return
}

View file

@ -12,7 +12,7 @@
export default {
async oncreate () {
let { makeProps, key } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
let { makeProps, key } = this.get()
if (makeProps) {
let props = await makeProps(key)
mark('VirtualListLazyItem set props')