TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

You might not need Redux

2 pointsby hamstercatover 8 years ago

1 comment

tracker1over 8 years ago
It&#x27;s sad that a post like this is needed... I wouldn&#x27;t consider doing a modern spa&#x2F;webapp of even medium complexity without a state machine similar to redux or redux itself. In a team setting it allows you to establish workflows that are consistent and easier to understand.<p>Also, your reducers and action creators don&#x27;t need to live together, I tend to import from the base directory into feature based structure&#x2F;directories. A given directory&#x2F;feature does not need to contain all of actions(creators), reducers, dumb&#x2F;smart&#x2F;pf components and sub-components. But by organizing data&#x2F;handlers into features and components into features, sometimes in the same directory, it makes it easier to find&#x2F;discover, though it may seem chaotic at first. Imho, it&#x27;s better than having to traverse through a deep tree to go from a component to a reducer, etc.<p>I really like redux, and I&#x27;m personally inclined to lean on it, even if it makes the code slightly more complex, that complexity is consistent and easier to follow than just about everything else I&#x27;ve seen.<p>That said, if you have state that doesn&#x27;t need to be persisted, then go ahead and keep that at a component level. You can have a higher level component with your actions and setstate, then pass them down to more simple components, or pure view functions.