An image

Corporate Blogs

What’s New In RxJS v6.5 And Check What Has Changed?

E-Commerce Businesses Need a Mobile App


If you’re one among the keen & thriving front-end developer, you must be already using or heard about rxjs unless you’re living under the rock. It is a reactive programming library which is designed mainly for functional programming paradigm. Recently, Rxjs 6.5 got released and it has few new things and deprecated in a lot of ways you can use some operators. Don’t worry its all fun, let’s dive right into it.



Before we hook up with the new additions of the library, we should go through what’s going to break your application sooner or later.


1. ForkJoin method signature has changed

Previously you were able to pass multiple arguments to forkjoin to add multiple observables to forkJoin. This is now deprecated and you must pass an array of observables to forkJoin operator. There is one more addition to forkJoin which we will see further down.



2) Partition Operator Deprecated

The partition operator is an interesting operator which is kind of similar to if else statement. What it does is, if you give it a source observable and a predicate, it’ll give you back two observables, one which satisfies the predicate condition and the other one which doesn’t. This operator is now deprecated and. But there is a new addition which does the exact thing in a different way. The below is the deprecated usage,



3) combineLatest Method Deprecated Signature Changes

The combineLatest operator’s method signature was quite verbose and it took me a while to figure out what’s actually deprecated from there. TLDR, from now on you can only pass an array of observables to combineLatest and other methods such as passing observables as separate parameters or passing a scheduler function is now deprecated.




4) Scheduler Deprecations

Scheduler functions are a way of controlling the timing of execution of tasks, don’t worry if this sounds alien because it is. The rxjs authors actually hidden the scheduler behind there default concurrency and in most cases, the concurrent execution is what we require. But there are multiple ways you can control the schedule for any observable and they are deprecated.

Likewise the scheduler version for of, range, from are also deprecated and a new scheduler creation function is added which we will see later.



Best To Read: 4 Must Known Operators In RxJS

Some Of The New Additions

We’ve been through a lot of deprecations and its time to know what cool things are added to the library.


Fetch Observable

The JS fetch API is what we can tell as the next version of AJAX and rxjs 6.5 added built-in support for it. Refer more about it here



Using this you can also cancel in-flight requests using AbortController.


ForkJoin Improvements

We discussed that forkJoin method signature has been changed and it’s for good, previously you were only able to send an array of observables and access them using their index in forkJoin. Now you can send an object of observables and access the values based on the object keys in the subscribe like below,



Partition Observable

We’ve seen that the partition operator has been deprecated and it is in favor of the new partition observable. This works as same as the partition operator which is if you give it an observable and a predicate it’ll give back two observables one satisfying the predicate and the other one doesn’t. You can use the partition observable as below.




Also use this link to refer more about partition observable

Scheduled Creation Function

We’ve seen the scheduler variants of all the creation function were deprecated that’s in favor of the scheduled creation function. You can wrap any observable with a scheduler using the scheduled function like below,




Read more about scheduled creation here


We have seen the new additions to rxjs 6.5 and deprecations. Probably rxjs team might give us a migration tool before removing these deprecated values. But we don’t have to wait until that point and can start upgrading your code based on the new changes. If you use a smart editor like Webstorm, the deprecated symbol usages will be struck out as a warning for you which is a lot helpful. Let me know if you have any feedback, questions, suggestions in the comments.


Like What You're Reading ?

Professional Life of an IT Consultant Interview with Valentin Crettaz
Written by
An energetic Fullstack developer/Tech Lead and has a strong desire in Programming. With 6.5 years of experience in Angular, Javascript, Laravel PHP, Ionic, and Flutter, he always strives to come up with Smart Solutions to accomplish complex tasks. He is also interested in Video games, Motorcycles, Books, Movies, History.

Leave a Comment

You have an Idea. We have the Solution.

We help business evolve with lates technologies and infrastructures tailored to their needs and market trends.