Skip to content

Commit 09ee1a4

Browse files
authored
docs: add async and await to store docs (#387)
1 parent 88281d7 commit 09ee1a4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/cookbook/store.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ For use with Nuxt, there are few key provisions:
102102

103103
@Action
104104
async getUsers() {
105-
const users = $axios.$get('/users')
105+
const users = await $axios.$get('/users')
106106
this.setUsers(users)
107107
}
108108
}
@@ -146,8 +146,8 @@ export const mutations: MutationTree<RootState> = {
146146
}
147147

148148
export const actions: ActionTree<RootState, RootState> = {
149-
fetchThings({ commit }) {
150-
const things = this.$axios.$get('/things')
149+
async fetchThings({ commit }) {
150+
const things = await this.$axios.$get('/things')
151151
console.log(things)
152152
commit('CHANGE_NAME', 'New name')
153153
},

0 commit comments

Comments
 (0)