Jul 2, 2019 in React JS
Q:

Explain the components of Redux.

1 Answer

0 votes
Jul 2, 2019

Redux is composed of the following components:

  • Action — Actions are payloads of information that send data from our application to our store. They are the only source of information for the store. We send them to the store using store.dispatch(). Primarly, they are just an object describes what happened in our app.
  • Reducer — Reducers specify how the application’s state changes in response to actions sent to the store. Remember that actions only describe what happened, but don’t describe how the application’s state changes. So this place determines how state will change to an action.
  • Store — The Store is the object that brings Action and Reducer together. The store has the following responsibilities: Holds application state; Allows access to state via getState(); Allows state to be updated viadispatch(action); Registers listeners via subscribe(listener); Handles unregistering of listeners via the function returned bysubscribe(listener).

Related questions

0 votes
Jun 19, 2020 in React JS
0 votes
Jun 19, 2020 in React JS
...