Brief Explanation On Store, Action And Reducer Concepts Of Redux.

Hey nerds, let's discuss Store, Action And Reducer Concepts In Brief.









What's Redux?

>> Redux is a predictable state container for JavaScript apps.

>> It helps you write applications that behave consistently, run in different environments (client, server, and native), and are easy to test. On top of that, it provides a great developer experience, such as It helps you write applications that behave consistently, run in different environments (client, server, and native), and are easy to test. On top of that, it provides a great developer experience, such as live code editing combined with a time-traveling debugger

>> As the application grows bigger and bigger it would be highly difficult to maintain the state of the entire app.

>> Redux helps us in solving this problem by using a global container called Store.



>> We can use Redux together with We can use Redux together with React , or with any other view library. It is tiny (2kB, including dependencies), but has a large ecosystem of addons available.



>> Read Read Full Documentation here.

>> To install Redux Library with NPM and node.js installed use "npm install --save redux" in command line.



Core Concepts Of Redux

>> Redux is entirely formed with three concepts which are Store, Action, and Reducer.





>> Store - It holds the state of the application until an action required.





>> Action - This is nothing but the changes made to the state of the application.





>> Reducer - This is the response for any action which carries out the state transformation.





>> The state of the application is stored in an object tree within a single store.





>> By that it means, our application state is usually maintained in a single object which would be managed by the Redux store.





>> To update the state of our app, we need to let redux about that within an action.





>> We are not allowed to directly update the state object.





>> We need to write correct Reducers to context how the state tree is transformed by actions.





>> A Reducer is nothing but a function that takes previous state and Action as arguments and returns newState.



Here is the lifecycle of a JavaScript app with Redux.





Store, Action, and Reducer(source Google)