Sivabalan
Sivabalan

Reputation: 1131

What is redux actually?

As i am a beginner on redux and i searched on the web about it. I got the answer as a state container. Even we can maintain the state of the element in the jquery just like the below code

if ($('.foobar').hasClass('active')) {
                doSomething();
         }

Can anyone tell me what it is actually?

Upvotes: 0

Views: 277

Answers (1)

Dave Newton
Dave Newton

Reputation: 160271

Redux is a state container.

You can maintain state in the DOM, but this is awful if you have an alternative. Why?

  • Harder to test: you need a fake DOM to test anything
  • Harder to reason about: multiple paths can update that state
  • Harder to debug: same reasons
  • Harder to maintain: same reasons

Being able to have a single, solid mechanism for mutating state is a huge win across the board. Having known mechanisms for interacting with that state, recording that state, tracking that state, etc. is a huge win.

Upvotes: 2

Related Questions