RXJS : moving from of() to scheduled() Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of RXJS : moving from of() to scheduled() without wasting too much if your time.

The question is published on by Tutorial Guruji team.

I was using the of() operator to create observables with simple values, e.g. of(navigator.onLine) but I had to update RxJS version and I get this linter warning of is deprecated, use scheduled instead.

It’s clearly not the exact same function and I should not be setting a scheduler.

How would you treat this ?

Any help appreciated.

Thanks.

Answer

This is was an rxjs bug, which is still open closed. Check here for more information

You can monitor this issue and for the meantime use:

// tslint:disable-next-line:deprecation
of(navigator.onLine);
We are here to answer your question about RXJS : moving from of() to scheduled() - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji