diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2018-04-06 08:38:19 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2018-04-06 08:38:19 +0000 |
commit | 703f45632292e7fc45359d0144cd616725bf9b0d (patch) | |
tree | a09f103580a88af7c84fc89d838e570da3df9de9 /doc/development | |
parent | 44376b3007deb1d27e59eee1a8704353a960c144 (diff) | |
download | gitlab-ce-703f45632292e7fc45359d0144cd616725bf9b0d.tar.gz |
Update vuex.md
Diffstat (limited to 'doc/development')
-rw-r--r-- | doc/development/fe_guide/vuex.md | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/doc/development/fe_guide/vuex.md b/doc/development/fe_guide/vuex.md index 56e26fd34b9..7298ffcd54a 100644 --- a/doc/development/fe_guide/vuex.md +++ b/doc/development/fe_guide/vuex.md @@ -115,9 +115,13 @@ create: 1. An action `requestSomething`, to toggle the loading state 1. An action `receiveSomethingSuccess`, to handle the success callback 1. An action `receiveSomethingError`, to handle the error callback -1. An action `fetchSomething` to make the request. +1. An action `fetchSomething` to make the request. + 1. In case your application does more than a `GET` request you can use these as examples: + 1. `PUT`: `createSomething` + 2. `POST`: `updateSomething` + 3. `DELETE`: `deleteSomething` -The component MUST only dispatch the `fetchNamespace` action. +The component MUST only dispatch the `fetchNamespace` action. Actions namespaced with `request` or `receive` should not be called from the component The `fetch` action will be responsible to dispatch `requestNamespace`, `receiveNamespaceSuccess` and `receiveNamespaceError` By following this pattern we guarantee: @@ -144,9 +148,6 @@ import { mapActions } from 'vuex'; }; ``` -#### Handling errors with `createFlash` -// TODO - #### `mutations.js` The mutations specify how the application state changes in response to actions sent to the store. The only way to change state in a Vuex store should be by committing a mutation. |