Skip to Main Content
Progresywne aplikacje webowe
book

Progresywne aplikacje webowe

by Tal Ater
February 2018
Intermediate to advanced content levelIntermediate to advanced
298 pages
9h 31m
Polish
APN Promise
Content preview from Progresywne aplikacje webowe
90 | Rozdział 5: Podejście najpierw tryb oine
Wpliku serviceworker.js dodaj
"/my-account.html"
,
"/js/my-account.js"
i
"/reserva
tions.
json"
dotablicy
CACHED_URLS
.
Wtym samym pliku dodaj następujące dwa warunki doobsługi zdarzenia fetch powa-
runku sprawdzającym żądania dla index.html:
} else if (requestURL.pathname === "/my-account") {
event.respondWith(
caches.match("/my-account.html").then(function(response) {
return response || fetch("/my-account.html");
})
);
} else if (requestURL.pathname === "/reservations.json") {
event.respondWith(
caches.open(CACHE_NAME).then(function(cache) {
return fetch(event.request).then(function(networkResponse) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mapowanie historyjek użytkownika

Mapowanie historyjek użytkownika

Jeff Patton
Nauka algorytmów

Nauka algorytmów

George Heineman

Publisher Resources

ISBN: 9788375413489