re: I'm Tracy Lee, a RxJS Core Team member and Google Developer Expert, ask me anything![FINISHED] VIEW POST

VIEW FULL DISCUSSION
 

RxJS is definitely a very powerful tool. But in my every day usages of async related things, I've never felt that I need to use something as powerful as RxJS to do it (instead opting to use something like async/await, promises, etc). Other than very specific use cases like making drag and drop ridiculously easy, RxJS really just felt like it was just killing a fly with a bazooka.

Do you have other examples of when you would prefer to use RxJS instead of other async related libraries?

 

Depends what your working on. When I worked in FinTech you have a large stream of events coming down the pipe. Something like Rx works very well for this.

 

Yes! For things like backpressure, multi plex web sockets, exponential backoff, cancellation - all these are great use cases for RxJS.

 

Yeah well honestly with RxJS the benefit is that you are moving your business logic into a domain specific language - so it's much easier to copy/paste code into new frameworks and libraries without large rewrites. You're also essentially future proofing your code two ways. The first is - RxJS provides an abstraction in the form of Observable for you so that you can easily change out the inputs at a later time. The second is - later on, it's much easier to add on functionality by just adding on another operator or chaining together a set of things, again, without having to rewrite your code much.

I'd say it's super smart to kill all the flies with a bazooka because later on you may be thankful you have that abstraction in place.

Also it's just more declarative and easier to read.

I always use RxJS so I don't have other recs on other libraries! :)

 

One of the selling points of React is to just write JS, no need to decipher a DSL. Why doesn’t RxJS take this approach?

code of conduct - report abuse