-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Traduction de actions.md
#12
Conversation
Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
docs/en/actions.md
Outdated
|
||
- Instead of mutating the state, actions commit mutations. | ||
- Actions can contain arbitrary asynchronous operations. | ||
- Au lieu de modifier le state, les actions committent des mutations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modifier l'état
actent des
docs/en/actions.md
Outdated
@@ -25,9 +25,9 @@ const store = new Vuex.Store({ | |||
}) | |||
``` | |||
|
|||
Action handlers receive a context object which exposes the same set of methods/properties on the store instance, so you can call `context.commit` to commit a mutation, or access the state and getters via `context.state` and `context.getters`. We will see why this context object is not the store instance itself when we introduce [Modules](modules.md) later. | |||
Les handlers d'action reçoivent un objet contexte qui expose le même set de méthodes/propriétés que l'instance du store, donc vous pouvez appeler `context.commit` pour commiter une mutation, ou accéder au state et aux getters via `context.state` et `context.getters`. Nous verrons pourquoi cet objet contexte n'est pas l'instance du store elle-même lorsque nous présenterons les [Modules](moduels.md) plus tard. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
les gestionnaires d'action
les mêmes méthodes/propriétés
acter une mutation
accéder à l'état et aux accesseurs
modules.md
docs/en/actions.md
Outdated
@@ -37,15 +37,15 @@ actions: { | |||
} | |||
``` | |||
|
|||
### Dispatching Actions | |||
### Dispatcher des actions dans les composants |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Propager des
docs/en/actions.md
Outdated
@@ -57,32 +57,31 @@ actions: { | |||
} | |||
``` | |||
|
|||
Actions support the same payload format and object-style dispatch: | |||
Les actions prennent en charge le même format de payload et *object-style dispatch* : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
également en charge les paramètres additionnels (« payload ») et les objets pour propager :
docs/en/actions.md
Outdated
|
||
``` js | ||
// dispatch with a payload | ||
// dispatcher avec un payload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
propager avec un paramètre additionnel
docs/en/actions.md
Outdated
|
||
### Dispatching Actions in Components | ||
### Dispatcher des actions dans les composants |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Propager
docs/en/actions.md
Outdated
|
||
You can dispatch actions in components with `this.$store.dispatch('xxx')`, or use the `mapActions` helper which maps component methods to `store.dispatch` calls (requires root `store` injection): | ||
Vous pouvez dispatcher des actions dans les composants avec `this.$store.dispatch('xxx')`, ou en utilisant le helper `mapActions` qui attache les méthodes du composant aux appels de `store.dispatch` (nécessite l'injection de `store` à la racine) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pouvez propager
la fonction utilitaire
docs/en/actions.md
Outdated
|
||
The first thing to know is that `store.dispatch` can handle Promise returned by the triggered action handler and it also returns Promise: | ||
La première chose à savoir est que `store.dispatch` retourne la valeur retournée par le handler de l'action déclenchée, vous pouvez donc retourner une Promise : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
peut gérer la Promesse (« Promise ») retournée par le gestionnaire d'action déclenché et par conséquent vous pouvez également retourner une Promesse :
docs/en/actions.md
Outdated
|
||
``` js | ||
// assuming getData() and getOtherData() return Promises | ||
// sachant que getData() et getOtherData() retournent des Promises |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getData()
etgetOtherData()
Promesses
docs/en/actions.md
Outdated
@@ -175,4 +175,4 @@ actions: { | |||
} | |||
``` | |||
|
|||
> It's possible for a `store.dispatch` to trigger multiple action handlers in different modules. In such a case the returned value will be a Promise that resolves when all triggered handlers have been resolved. | |||
> Il est possible pour un `store.dispatch` de déclencher plusieurs handlers d'action dans différents modules. Dans ce genre de cas, la valeur retournée sera une Promise qui se résoud quand tous les handlers déclenchés ont été résolus. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gestionnaires d'action
une Promesse
gestionnaires déclenchés
docs/en/actions.md
Outdated
@@ -25,9 +25,9 @@ const store = new Vuex.Store({ | |||
}) | |||
``` | |||
|
|||
Action handlers receive a context object which exposes the same set of methods/properties on the store instance, so you can call `context.commit` to commit a mutation, or access the state and getters via `context.state` and `context.getters`. We will see why this context object is not the store instance itself when we introduce [Modules](modules.md) later. | |||
Les handlers d'action reçoivent un objet contexte qui expose le même set de méthodes/propriétés que l'instance du store, donc vous pouvez appeler `context.commit` pour commiter une mutation, ou accéder au state et aux getters via `context.state` et `context.getters`. Nous verrons pourquoi cet objet contexte n'est pas l'instance du store elle-même lorsque nous présenterons les [Modules](moduels.md) plus tard. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expose le même ensemble de méthodes/propriétés
elle-même, lorsque
docs/en/actions.md
Outdated
@@ -94,11 +94,11 @@ actions: { | |||
} | |||
``` | |||
|
|||
Note we are performing a flow of asynchronous operations, and recording the side effects (state mutations) of the action by committing them. | |||
Notez que nous procédons à un flux d'opérations asynchrones, et enregistrons les effets de bord (mutation du state) de l'action en les committant. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
les actant
Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
Merci pour tes retours @Kocal, c'est dans la boite ! |
C'est parti pour de l'action !