feat: move from life cycle to data or watcher
- remove from created / mounted - initialize component services in data - use immediate watcher where appropriate - deep watch for route changes
This commit is contained in:

committed by
kolaente

parent
ebeca48be4
commit
f51371bbe0
@ -78,13 +78,13 @@ export default {
|
||||
return {
|
||||
backgroundSearchTerm: '',
|
||||
backgroundSearchResult: [],
|
||||
backgroundService: null,
|
||||
backgroundService: new BackgroundUnsplashService(),
|
||||
backgroundThumbs: {},
|
||||
currentPage: 1,
|
||||
backgroundSearchTimeout: null,
|
||||
|
||||
backgroundUploadService: null,
|
||||
listService: null,
|
||||
backgroundUploadService: new BackgroundUploadService(),
|
||||
listService: new ListService(),
|
||||
}
|
||||
},
|
||||
computed: mapState({
|
||||
@ -94,9 +94,6 @@ export default {
|
||||
hasBackground: state => state.background !== null,
|
||||
}),
|
||||
created() {
|
||||
this.backgroundService = new BackgroundUnsplashService()
|
||||
this.backgroundUploadService = new BackgroundUploadService()
|
||||
this.listService = new ListService()
|
||||
this.setTitle(this.$t('list.background.title'))
|
||||
// Show the default collection of backgrounds
|
||||
this.newBackgroundSearch()
|
||||
|
Reference in New Issue
Block a user