refactor(service-worker): ensure compatibility with typescript strict flag (#30993)
As part of FW-1265, the `@angular/service-worker` package is made compatible with the TypeScript `--strict` flag. Read more about the strict flag [here](https://www.typescriptlang.org/docs/handbook/compiler-options.html) PR Close #30993
This commit is contained in:
parent
221cbd0b47
commit
69a612d402
@ -76,7 +76,7 @@ export class NgswCommChannel {
|
|||||||
const currentController = defer(() => of (serviceWorker.controller));
|
const currentController = defer(() => of (serviceWorker.controller));
|
||||||
const controllerWithChanges = concat(currentController, controllerChanges);
|
const controllerWithChanges = concat(currentController, controllerChanges);
|
||||||
|
|
||||||
this.worker = controllerWithChanges.pipe(filter<ServiceWorker>(c => !!c));
|
this.worker = controllerWithChanges.pipe(filter((c): c is ServiceWorker => !!c));
|
||||||
|
|
||||||
this.registration = <Observable<ServiceWorkerRegistration>>(
|
this.registration = <Observable<ServiceWorkerRegistration>>(
|
||||||
this.worker.pipe(switchMap(() => serviceWorker.getRegistration())));
|
this.worker.pipe(switchMap(() => serviceWorker.getRegistration())));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user