Skip to content

Instantly share code, notes, and snippets.

@ziyadElon
Last active July 28, 2019 13:15
Show Gist options
  • Save ziyadElon/a0f5b4db3fbd361ca73a5d73c822956d to your computer and use it in GitHub Desktop.
Save ziyadElon/a0f5b4db3fbd361ca73a5d73c822956d to your computer and use it in GitHub Desktop.
Service Worker ImportScripts
// This is the main service worker which will be registered.
importScripts('sw-1.js', 'sw-2.js');
console.log(currentCacheName); //output: hello
// sw-1.js
var currentCacheName = 'cache:v1';
// sw-2.js
var currentCacheName = "hello";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment