Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/en/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ Example testing an async action:
// actions.js
import shop from '../api/shop'

export const getAllProducts = ({ dispatch }) => {
dispatch('REQUEST_PRODUCTS')
export const getAllProducts = ({ commit }) => {
commit('REQUEST_PRODUCTS')
shop.getProducts(products => {
dispatch('RECEIVE_PRODUCTS', products)
commit('RECEIVE_PRODUCTS', products)
})
}
```
Expand Down
6 changes: 3 additions & 3 deletions docs/fr/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ Exemple de test d'une action asynchrone :
// actions.js
import shop from '../api/shop'

export const getAllProducts = ({ dispatch }) => {
dispatch('REQUEST_PRODUCTS')
export const getAllProducts = ({ commit }) => {
commit('REQUEST_PRODUCTS')
shop.getProducts(products => {
dispatch('RECEIVE_PRODUCTS', products)
commit('RECEIVE_PRODUCTS', products)
})
}
```
Expand Down
6 changes: 3 additions & 3 deletions docs/ja/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ describe('mutations', () => {
// actions.js
import shop from '../api/shop'

export const getAllProducts = ({ dispatch }) => {
dispatch('REQUEST_PRODUCTS')
export const getAllProducts = ({ commit }) => {
commit('REQUEST_PRODUCTS')
shop.getProducts(products => {
dispatch('RECEIVE_PRODUCTS', products)
commit('RECEIVE_PRODUCTS', products)
})
}
```
Expand Down
6 changes: 3 additions & 3 deletions docs/ru/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ describe('mutations', () => {
// actions.js
import shop from '../api/shop'

export const getAllProducts = ({ dispatch }) => {
dispatch('REQUEST_PRODUCTS')
export const getAllProducts = ({ commit }) => {
commit('REQUEST_PRODUCTS')
shop.getProducts(products => {
dispatch('RECEIVE_PRODUCTS', products)
commit('RECEIVE_PRODUCTS', products)
})
}
```
Expand Down
6 changes: 3 additions & 3 deletions docs/zh-cn/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ Actions 应对起来略微棘手,因为它们可能需要调用外部的 API
// actions.js
import shop from '../api/shop'

export const getAllProducts = ({ dispatch }) => {
dispatch('REQUEST_PRODUCTS')
export const getAllProducts = ({ commit }) => {
commit('REQUEST_PRODUCTS')
shop.getProducts(products => {
dispatch('RECEIVE_PRODUCTS', products)
commit('RECEIVE_PRODUCTS', products)
})
}
```
Expand Down