ReasonJun

Redux : What is Redux 본문

Frontend/Redux

Redux : What is Redux

ReasonJun 2023. 8. 19. 12:54
728x90

Redux is an open-source JavaScript library for managing and centralizing application state. It is most commonly used with libraries such as React or Angular for building user interfaces. Similar to Facebook's Flux architecture, it was created by Dan Abramov and Andrew Clark.

 

Redux follows a unidirectional data flow architecture, which means that data can only flow from the actions to the reducers, and then to the store. This makes it easier to reason about the state of the application and to track changes over time.

 

Redux consists of three main concepts:

  • Store: The store is the central location where the application state is stored. It is an immutable object, which means that it can never be changed directly. Instead, changes to the state are made by dispatching actions.
  • Actions: Actions are plain JavaScript objects that describe a change to the state. They are dispatched by components or other parts of the application.
  • Reducers: Reducers are functions that take the current state and an action as input, and return a new state. They are responsible for updating the state in a consistent and predictable way.

Redux is a powerful tool for managing application state, but it can be a bit complex to learn. However, there are many resources available to help you get started, including the official Redux documentation and tutorials.

Here are some of the benefits of using Redux:

  • Predictability: Redux ensures that the state of your application is always predictable. This makes it easier to reason about the code and to debug problems.
  • Centralization: Redux centralizes the state of your application in a single place. This makes it easier to manage and update the state.
  • Testing: Redux makes it easier to test your application. The Redux DevTools can be used to track changes to the state and to debug problems.
  • Flexibility: Redux is flexible and can be used with any UI layer. It also has a large ecosystem of addons to fit your needs.

If you are developing a complex JavaScript application, Redux is a great tool to consider for managing your application state. It can help you write code that is predictable, centralized, and testable.

Here are some of the limitations of Redux:

  • Complexity: Redux can be a bit complex to learn and use.
  • Performance: Redux can have a negative impact on performance if it is not used carefully.
  • Not necessary for all applications: Redux is not necessary for all applications. If your application has a simple state, you may not need to use Redux.

Overall, Redux is a powerful tool that can be used to manage the state of complex JavaScript applications. However, it is important to weigh the benefits and limitations of Redux before deciding whether or not to use it in your application.

 

https://levelup.gitconnected.com/a-reduced-explanation-of-redux-reducers-actions-and-store-9b7819c5d064

 

728x90

'Frontend > Redux' 카테고리의 다른 글

Redux: toolkit  (0) 2023.08.19
Redux : middleware / Thunk  (0) 2023.08.19
Redux : Provider / useSelector / useDispatch  (0) 2023.08.19
Redux: CombineReducers  (0) 2023.08.19
Redux: strict unidirectional data flow  (0) 2023.08.19
Comments