-
-
Save FlorianRappl/f41c0a4e2ebdc2deeb7a2c9036763140 to your computer and use it in GitHub Desktop.
This file contains 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
self.addEventListener('fetch', async e => { | |
const req = e.request; | |
const res = isApiCall(req) ? getFromNetwork(req) : getFromCache(req); | |
await e.respondWith(res); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment