From bcc0a035cc2fcbbab7b03d6af0477757366b5876 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Sat, 13 Jun 2020 10:55:53 +0300 Subject: [PATCH] docs(service-worker): update default value of `SwRegistrationOptions#registrationStrategy` (#37555) The default value was changed from `registerWhenStable` to `registerWhenStable:30000` in 29e8a64cf02fa9b80d38c30091e0b730403c54c8, but the decumentation was not updated to reflect that. This commit updates the documentation to mention the correct default value. PR Close #37555 --- aio/content/guide/service-worker-communications.md | 6 ++---- packages/service-worker/src/module.ts | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/aio/content/guide/service-worker-communications.md b/aio/content/guide/service-worker-communications.md index 70863db3f6..28c428c42c 100644 --- a/aio/content/guide/service-worker-communications.md +++ b/aio/content/guide/service-worker-communications.md @@ -42,10 +42,8 @@ This method returns a `Promise` which indicates that the update check has comple
-In order to avoid negatively affecting the initial rendering, `ServiceWorkerModule` will by default -wait for the app to stabilize, before registering the ServiceWorker script. Constantly polling for -updates, e.g. with `interval()`, will prevent the app from stabilizing and the ServiceWorker -script will never be registered with the browser. +In order to avoid negatively affecting the initial rendering of the page, `ServiceWorkerModule` will by default wait for up to 30 seconds for the app to stabilize, before registering the ServiceWorker script. +Constantly polling for updates, e.g. with [setInterval()](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval) or RxJS' [interval()](https://rxjs.dev/api/index/function/interval), will prevent the app from stabilizing and the ServiceWorker script will not be registered with the browser until the 30 seconds upper limit is reached. You can avoid that by waiting for the app to stabilize first, before starting to poll for updates (as shown in the example above). diff --git a/packages/service-worker/src/module.ts b/packages/service-worker/src/module.ts index 4c404845ad..8a47ce456c 100644 --- a/packages/service-worker/src/module.ts +++ b/packages/service-worker/src/module.ts @@ -70,7 +70,7 @@ export abstract class SwRegistrationOptions { * The function will be used at runtime to obtain and subscribe to the `Observable` and the * ServiceWorker will be registered as soon as the first value is emitted. * - * Default: 'registerWhenStable' + * Default: 'registerWhenStable:30000' */ registrationStrategy?: string|(() => Observable); }