Skip to content

Commit

Permalink
remove unnecessary sveltejs/svelte#1354 workarounds (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson authored May 5, 2018
1 parent 833afc5 commit a88fb70
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions routes/_components/compose/ComposeAutosuggest.html
Original file line number Diff line number Diff line change
Expand Up @@ -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})
})
}
Expand Down
2 changes: 1 addition & 1 deletion routes/_components/compose/ComposeLengthGauge.html
Original file line number Diff line number Diff line change
Expand Up @@ -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}))
Expand Down
2 changes: 1 addition & 1 deletion routes/_components/compose/ComposeLengthIndicator.html
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
8 changes: 2 additions & 6 deletions routes/_components/timeline/Timeline.html
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,7 @@ <h1 class="sr-only">{label}</h1>
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 ||
Expand All @@ -200,7 +196,7 @@ <h1 class="sr-only">{label}</h1>
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
}
Expand Down
2 changes: 1 addition & 1 deletion routes/_components/virtualList/VirtualListLazyItem.html
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit a88fb70

Please sign in to comment.