dotintegral 's Account

dotintegral offline 5 years

React Hooks + RxJS or How React Is Meant to Be

0

I really like RxJS and would love to use is more often than I do. But, I have worked in a react project that had its state management replaced with stream library. Though initially it was a neat idea and made some sense to me, quickly I realised that it's not something I would recommend anytime soon. The main con of this setup was the ability os seeing what's going on in the application. Though Redux is pretty simple, everything happens as a result of actions. I agree, that sometimes tracking the origins of an action in middleware might be difficult. On the other side it's totally transparent, by that I mean that it's easy to see that changes to the global state were made because of a given action. I can easily look through all fired actions because there are some great tools, like the simple redux-logger or browser extensions. The RxJS has a great problem - it's hard to debug. There are no really good tools to look inside the streams and figure out what's happening. Most of the times I found myself just writting 'tap' functions and setting breakpoints where I thought that something might be going wrong. This, combined with the async nature of RxJS, makes debugging really painful process. It might not be easy to see when working with simple application that does not requires complicated streams. But with more complicated cases, as in most commercial project, streams are getting more complicated as well. And debugging them becomes an issue. This is why I don't recommend this approach for commercial projects.

Sign in

Forgot password?

Or use a social network account

 

By Signing In \ Signing Up, you agree to our privacy policy

Password recovery

You can also try to

Or use a social network account

 

By Signing In \ Signing Up, you agree to our privacy policy