Redux Flashcards

1
Q

When is redux useful ?

A

Redux is more useful when: (4)

You have large amounts of application state that are needed in many places in the app
The app state is updated frequently over time
The logic to update that state may be complex
The app has a medium or large-sized codebase, and might be worked on by many people

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

What is Redux ?

A

library used for updating and managing application state, using events called “actions”.It serves as a centralized store for state that needs to be used across your entire application, with rules ensuring that the state can only be updated in a predictable fashion.

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

Action

A

An action is a plain JavaScript object that has a type field. You can think of an action as an event that describes something that happened in the application.

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

Reducers

A

A reducer is a function that receives state and action and decide how to update state if necessary and returns the new state: (state, action) => newState (think as an event listener)

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

Store

A

The current Redux application state lives in an object called the store .

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

Dispatch

A

the only way to update state is to call store.dispatch() and pass an action object.
You can think of dispatching actions as “triggering an event” in the application. Something happened, and we want the store to know about it.

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

Redux Slices

A

list of reducers of the same category

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

Selectors

A

Selectors are functions that know how to extract specific pieces of information from a store state value.

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