Move some interactions to the backendInteractor
The idea is that all interactions should move there, so components don't have to pass around credentials all the time.
This commit is contained in:
parent
b1f9f6395c
commit
215e51f764
6 changed files with 50 additions and 9 deletions
|
@ -1,5 +1,6 @@
|
|||
import apiService from '../services/api/api.service.js'
|
||||
import timelineFetcher from '../services/timeline_fetcher/timeline_fetcher.service.js'
|
||||
import backendInteractorService from '../services/backend_interactor_service/backend_interactor_service.js'
|
||||
|
||||
const users = {
|
||||
state: {
|
||||
|
@ -29,7 +30,10 @@ const users = {
|
|||
user.credentials = userCredentials
|
||||
commit('setCurrentUser', user)
|
||||
})
|
||||
// Start getting fresh tweets.
|
||||
.then(() => timelineFetcher.startFetching({store, credentials: userCredentials}))
|
||||
// Set our new backend interactor
|
||||
.then(() => commit('setBackendInteractor', backendInteractorService(userCredentials)))
|
||||
}
|
||||
commit('endLogin')
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue