Open Albejr opened 6 years ago
Same trouble here, but I managed to get it working with rxjs 6.2.2. I don't know much about github, so I'll leave my changes here.... Maybe it will be helpful to someone who passes by this issue... And if we are in any luck, maybe the maintainer will fix it ;-)
In src/services/network-status.service.ts:
- import { Observable } from 'rxjs/Rx';
+ import { Observable, interval } from 'rxjs';
+ import { timeInterval,map} from 'rxjs/operators';
- private registerNetworkHealthChecker(interval: number, options: Options) {
- this.networkStatus = Observable
- .interval(interval)
- .timeInterval()
- .map(() => {
- if(window.navigator.onLine) {
- if(options.grayscale.enabled) {
- this.removeGrayScaleEffect(options.grayscale.animationDuration);
- }
- return true;
- } else {
- if(options.grayscale.enabled) {
- this.addGrayScaleEffect(options.grayscale.percentage,
- options.grayscale.animationDuration);
- }
- return false;
- };
- });
- }
+ private registerNetworkHealthChecker(int: number, options: Options) {
+
+ const interval$ = interval(int);
+
+ this.networkStatus = interval$.pipe(
+ timeInterval(),
+ map(() => {
+ if (window.navigator.onLine) {
+ if (options.grayscale.enabled) {
+ _this.removeGrayScaleEffect(options.grayscale.animationDuration);
+ }
+ return true;
+ } else {
+ if (options.grayscale.enabled) {
+ _this.addGrayScaleEffect(options.grayscale.percentage, options.grayscale.animationDuration);
+ }
+ return false;
+ }
+ })
+ )
+ }
Summary
I'm submitting a:
Description
Necessary to compatibility of import paths to new structure.![image](https://user-images.githubusercontent.com/24717256/39650089-3ecc599a-4fbd-11e8-852a-858d3f24b0a5.png)
Demo
Lib versions: