Last active
July 28, 2019 13:15
-
-
Save ziyadElon/a0f5b4db3fbd361ca73a5d73c822956d to your computer and use it in GitHub Desktop.
Service Worker ImportScripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is the main service worker which will be registered. | |
importScripts('sw-1.js', 'sw-2.js'); | |
console.log(currentCacheName); //output: hello |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sw-1.js | |
var currentCacheName = 'cache:v1'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sw-2.js | |
var currentCacheName = "hello"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment