Skip to content

Instantly share code, notes, and snippets.

@arackaf
Created December 2, 2017 02:37
Show Gist options
  • Save arackaf/1f81dc92bfe4a8b3bc3ab959182d72de to your computer and use it in GitHub Desktop.
Save arackaf/1f81dc92bfe4a8b3bc3ab959182d72de to your computer and use it in GitHub Desktop.
toolbox.router.get(/books$/, handleMain);
toolbox.router.get(/subjects$/, handleMain);
toolbox.router.get(/localhost:3000\/$/, handleMain);
toolbox.router.get(/mylibrary.io$/, handleMain);
function handleMain(request) {
return fetch(request).catch(() => {
return caches.match("react-redux/offline.htm", { ignoreSearch: true });
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment