Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RXJS : moving from of() to scheduled()

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.

like image 678
kfa Avatar asked Apr 30 '19 09:04

kfa


1 Answers

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);
like image 127
Poul Kruijt Avatar answered Sep 28 '22 17:09

Poul Kruijt