skipWaiting.js 873 B

123456789101112131415161718192021222324252627
  1. /*
  2. Copyright 2019 Google LLC
  3. Use of this source code is governed by an MIT-style
  4. license that can be found in the LICENSE file or at
  5. https://opensource.org/licenses/MIT.
  6. */
  7. import { logger } from './_private/logger.js';
  8. import './_version.js';
  9. /**
  10. * This method is deprecated, and will be removed in Workbox v7.
  11. *
  12. * Calling self.skipWaiting() is equivalent, and should be used instead.
  13. *
  14. * @memberof workbox-core
  15. */
  16. function skipWaiting() {
  17. // Just call self.skipWaiting() directly.
  18. // See https://github.com/GoogleChrome/workbox/issues/2525
  19. if (process.env.NODE_ENV !== 'production') {
  20. logger.warn(`skipWaiting() from workbox-core is no longer recommended ` +
  21. `and will be removed in Workbox v7. Using self.skipWaiting() instead ` +
  22. `is equivalent.`);
  23. }
  24. void self.skipWaiting();
  25. }
  26. export { skipWaiting };