4 ms·
Ask HN: What to Learn in 2020: Redux vs. RxJS vs. Context-API
Starting a greenfield React app, is it still state-of-the art to use Redux as state manager.
Will Redux still be around in 2 years or will it be replaced by simpler options? Any thoughts on that?
- dexwiz 7y agoRedux will be around for a while due to the number of people who already use it, but may not be a first choice at some point. RxJS is kind of equivalent to Promises + Utils. You can use it to structure code, but it won’t solve state issues on its own. I don’t know enough context api to comment on it.
- WolfOliver 7y agoTo me it looks like you can implement a proven MVC architecture using React Hooks and RxJS: https://blog.logrocket.com/rxjs-with-react-hooks-for-state-management/ https://blog.logrocket.com/rxjs-with-react-hooks-for-state-m... So should it be powerfull enought?
- WolfOliver 7y ago... Not exactly an MVC but a separation between view and business using the subscriber pattern.
- dexwiz 7y agoIn that case you are using hooks to manage your state and RxJS to abstract over the concurrent behavior. IIRC you can use a few things to handle concurrency for hooks like promises, Async/await, or callbacks.
- acemarke 7y agoHi, I'm a Redux maintainer. I can confirm that Redux will be around for a very long time, and it's easier to use it now than ever before. Please see my post "Redux - Not Dead Yet!" [0] for information on how Redux compares to other options like context in today's React ecosystem. Also, note that you should be using our new official Redux Toolkit package [1] to write your Redux logic, our "Style Guide" docs page [2] provides guidance on recommended patterns and best practices, and our Redux templates for Create-React-App [3] come with RTK and React-Redux hooks set up out of the box. [0] https://blog.isquaredsoftware.com/2018/03/redux-not-dead-yet/ https://blog.isquaredsoftware.com/2018/03/redux-not-dead-yet... [1] https://redux-toolkit.js.org https://redux-toolkit.js.org [2] https://redux.js.org/style-guide/style-guide https://redux.js.org/style-guide/style-guide [3] https://github.com/reduxjs/cra-template-redux https://github.com/reduxjs/cra-template-redux
- hknd 7y agoIt's the same every year: learn and completely understand the basics - the rest will follow. If you know how latest react works you don't need redux or rxjs as hooks can solve most problems in a reusable way. Example: https://github.com/oldboyxx/jira_clone https://github.com/oldboyxx/jira_clone