1 min read

State, Actions, and Reducers in Redux

Let's dive in and check how Redux can help us build maintainable apps by giving us a single central place to put global app state. We will also discuss about core Redux concepts like dispatching action objects and using reducer functions that return new state values.
State, Actions, and Reducers in Redux

State: With Redux, our application state is always kept in plain JavaScript objects and arrays. That means you may not put other things into the Redux state.

Action: Actions are plain JavaScript objects that have a type field. As mentioned earlier, you can think of an action as an event that describes something that happened in the application.

Reducers: Reducers are functions that take the current state and an action as arguments, and return a new state result. In other words, (state, action) => newState.

https://1.bp.blogspot.com/-dpNOO0R1KSE/XpTCxvoWrcI/AAAAAAAAAHo/EUwCRdA8lyYuILcZ7R6snNuLeqq8PjskgCNcBGAsYHQ/s1600/redux-flow-diagram.jpg
Redux Fundamentals, Part 3: State, Actions, and Reducers | Redux
The official Redux Fundamentals tutorial: learn how reducers update state in response to actions
https://redux.js.org/tutorials/fundamentals/part-3-state-actions-reducers

#Redux #Action #State #Reducers #Probyto #PrpbytoAI

Subscribe & Follow us for latest in field of AI & Tech and stay updated!
Facebook: https://facebook.com/probyto
Twitter: https://twitter.com/probyto
LinkedIn: https://linkedin.com/company/probyto
Instagram: https://instagram.com/probyto