What is Redux and why is it important in JS?

Hello, I often see people use the term "Redux" often in JS, can someone explain what it is and why is it important please.
17 Replies
Ganesh
Ganesh3w ago
Redux - A JS library for predictable and maintainable global state ...
A JS library for predictable and maintainable global state management
Faker
FakerOP3w ago
yeah I did have a look :c, it's still a bit unclear though, basically it's just a way where we store our variables, in a global object?
Ganesh
Ganesh3w ago
It's a library for global state management. Personally I haven't used anything besides context that comes with react so I can't tell you much But it probably makes it easier to manage global state (note I said global) than vanilla react Have you done a project yet that requires global states That might make it easier to understand since you would know the problem
Faker
FakerOP3w ago
ah ok no not yet, I only use local state, like, one .jsx file = 1 state, global state we mean multiple .jsx file sharing states?
Ganesh
Ganesh3w ago
Global state means state that your whole application uses.
Faker
FakerOP3w ago
yeah I see
Ganesh
Ganesh3w ago
User theme is an example, you store the light or dark theme as state
Faker
FakerOP3w ago
yeah we would use that across multiple thing, so it's a global state
Ganesh
Ganesh3w ago
And then all components might use that to know which theme to follow
Faker
FakerOP3w ago
yepp I see, make sense now, thanks !
Ganesh
Ganesh3w ago
Someone who has used redux or any other state management lib would probably have better insight in this. This is just what i understand
Faker
FakerOP3w ago
I have an overview of what it is now, thanks !!
haquanq
haquanq3w ago
Redux or any other state management libs provide an opinionated way of handling data flow that delegate the design decision to it's author (you can achieve this with React useContext), meaning developers don't have to spend their time thinking how should they design a data flow for their app but use an existed solution instead.
b1mind
b1mind3w ago
Signals ❤️ Wont do you any good in React but everyother framework has signals now
Faker
FakerOP3w ago
oh didn't heard of that how do signals work? it's the same thing in the sense we use it for global state?
b1mind
b1mind3w ago
Pretty much
Faker
FakerOP3w ago
yep I see

Did you find this page helpful?