JSFiddle - React, Tailwind, and code Playground
JavaScript
const RESOURCE_CACHE = 'resources-v1';
caches.open(RESOURCE_CACHE).then(function addUrlsToCache(cache) {
return cache.addAll([
'/resources/style.css',
'/resources/fonts/led',
'/resources/script.js',
'/img/roundel-tube.png',
'/img/roundel-dlr.png',
'/img/roundel-overground.png',
]);
}).catch(function (error) {
console.clear();
console.error("Failed to cache resources:", error.message);
})