Redux App Development

What is Redux? Will you use Redux in your apps from now?

What Is Redux?

Redux is a JavaScript library that enable you to have centralised state and logic for your apps. Having a global state that is a powerful time-saver because it can be accessed with an ease from any child component.

It can also be implemented in any JavaScript application, but we’re going to learn how to use it with React.

What’s New?

Redux introduces the following new concepts:

  1. Store
  2. Dispatching
  3. Action Type
  4. Action Creator
  5. Reducer

Redux Terminology

  1. Store – Holds all the application’s state. It needs a reducer.
  2. Dispatch – The method we use to call for a state change.
  3. Action Type – A simple constant that holds the name of the action creator.
  4. Action Creator – A method that lets the reducer know what action we want to perform.
  5. Reducer – The main piece. Here we dictate the logic for changing the state.

The Process

We first create Action Type which is just a constant.
Then we create an Action Creator based on imported type. In the return we pass the Payload (new state). We can now create the initial state inside the Reducer and update it with the Payload based on Action Type.

Basically, every time we want to change the state, we dispatch an action, which will trigger the reducer logic to change the state.

React-Redux

React however, without react-redux node package, would not be able to communicate to the store.

This package introduces 2 handy React hooks:

React Redux

mapStatetoProps()
We use this everytime we need the reducer’s state.

mapDispatchtoProps()
We use this everytime we want to change the reducer’s state.

connect()
Links our component with mapStatetoProps() and mapDispatchtoProps()

READ MORE: How to Use Redux in Your ReactJS App in Just 10 Minutes?

Final Words

Redux is not extremely hard. It takes time to set it up, and perform your first 2 state changes. After that, it is actually fine.

But don’t worry i will help 🙂

Part 2 is a practical Redux post. I will show you how to set it up with React and Code those 2 state changes. Essentially all the hard parts. Stay Tune.

That was it!

Rahul Sharma

Rahul Sharma is a Founder of Logical IDEA and Bee Flirty. He is a Professional WP Developers, UX Designer, and Digital Marketing Expert. Previously, He Worked as a Digital Marketing Head for An eCommerce Startup. He Graduated with honors from Lovely Professional University with a Dual Degree in Information Technology.

13 comments

  • Sarah says:

    If you want to take much from this piece of writing then you have to apply such techniques to your own website. Lucio Arabie

  • Sid Yellowhair says:

    A round of applause for your blog. Really looking forward to read more. Great.

  • Royal Machia says:

    Wonderful article! We are linking to this great article on our site. Keep up the good writing.

  • Gilbert Dughi says:

    If you want to increase your experience only keep visiting this site and be updated with the most up-to-date gossip posted here.

  • Porno izle says:

    Always a significant fan of linking to bloggers that I enjoy but dont get a good deal of link enjoy from. Granville Friedeck

  • Jgonzalez Bravo says:

    Some truly select articles on this internet site, saved to my bookmarks. Dewayne Schreuder

  • Bobby Velazco says:

    Pretty! This was an incredibly wonderful article. Thanks for providing this information.

  • bahis says:

    There is visibly a package to understand about this. I think you made certain great points in functions additionally. Kurt Oflynn

  • Emmanuel Matas says:

    I pay a quick visit day-to-day a few web sites and sites to read articles, however this blog gives quality based writing.

  • Eldon Rei says:

    I got what you mean,saved to bookmarks, very decent site.

  • Shelby Canevari says:

    Always look for an easy pass you can make to a player who is open.

  • Eusebio Kohlhoff says:

    Appreciate you sharing, great blog article. Really looking forward to read more. Really Cool.

  • D. Travis Boorman says:

    I believe this web site contains some really fantastic info for everyone :

Leave a Reply

Your email address will not be published.