-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed
Description
Hey, starting with koa on back-end, a lot of stuff are moving to async/await (*/yield for now), what I suggest is adding async/await functions support to methods so it's allowed to do like:
import DBService from './db'
new Vue({
el: document.body,
data: {
user: {},
friends: []
},
methods: {
async getUserData () {
this.user = await DBService.getUser()
this.friends = await DBService.getFriends(this.user.id)
}
}
})
This looks like a cleaner way of doing async stuff to me, what do you think?
P.S. Same can be used for Vuex actions.
TitanFighter, fraunos, kingRayhan, creazy231, icalrn and 7 more
Metadata
Metadata
Assignees
Labels
No labels