Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Redux Actions | Fundamental Concepts
Introduction to Redux

bookRedux 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.

question mark

Select the most appropriate type for an action of slice todo and action name addTodo:

Select the correct answer

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 1

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

Awesome!

Completion rate improved to 3.45

bookRedux Actions

Pyyhkäise näyttääksesi valikon

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.

question mark

Select the most appropriate type for an action of slice todo and action name addTodo:

Select the correct answer

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 1
some-alt