Redux Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is the first principle of Redux?

A

A Single Source of Truth: The single immutable state tree. The whole state of your application is stored as a single JavaScript object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an action in Redux?

A
  • Actions are payloads of information that send data from your application to your store.
  • They are the only source of information for the store.
  • Actions are plain JavaScript objects.
  • Actions must have a type property that indicates the type of action being performed.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the second principle of Redux?

A

State is Read-Only: The only way to change the state is to emit an action, an object describing what happened.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the third principle of Redux?

A

Changes are made with pure functions: To specify how the state tree is transformed by actions, you write pure reducers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a reducer in Redux?

A

Reducers are just pure functions that take the previous state and an action, and return the next state.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly