Redux Actions
In code, an action is simply a plain JavaScript object having a type key:
const incrementAction = {
type: 'counter/increment'
};
Additional keys can be added to represent information or data related to the action:
const incrementAction = {
type: 'counter/increment',
amount: 7
};
The types are named in a specific way by convention. The general syntax is domain/eventName
. In this above case, it is counter/increment
.
The domain represents the category of the action, while the eventName
represents the event itself.
Takk for tilbakemeldingene dine!
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Awesome!
Completion rate improved to 3.45
Redux Actions
Sveip for å vise menyen
In code, an action is simply a plain JavaScript object having a type key:
const incrementAction = {
type: 'counter/increment'
};
Additional keys can be added to represent information or data related to the action:
const incrementAction = {
type: 'counter/increment',
amount: 7
};
The types are named in a specific way by convention. The general syntax is domain/eventName
. In this above case, it is counter/increment
.
The domain represents the category of the action, while the eventName
represents the event itself.
Takk for tilbakemeldingene dine!