Redux Flashcards

1
Q

Tell me what you know about actions and how they work.

A
  1. Actions are the only way view components communicate changes to the store.
  2. Actions are POJOs with a mandatory “type” key, and optional payload keys containing new data.
  3. Actions and action creators are dispatched to move along in the Redux loop.
  4. Use action creators when dealing with dynamic data. They are functions that return a POJO, or an action.
Insider Tip: 
5. export const string literal action types to raise error in Reducer if misspelled action. 
(i.e.
export const ADD_FRUIT = "ADD_FRUIT";
export const ADD_FRUITS = "ADD_FRUITS";
export const SELL_FRUIT = "SELL_FRUIT";
)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Store?

A
// store is a POJO that holds the global state of application
// Store is responsible for:
1. updating app state via reducers
2. shares state to the apps view layers
3. listen to actions?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly