websetup/ts/serviceworker/index.ts

12 lines
420 B
TypeScript
Raw Normal View History

2019-03-27 13:38:24 +00:00
export const setupServiceWoker = async () => {
// serviceworker
const script = document.createElement('script');
script.onload = () => {
2019-03-27 13:40:06 +00:00
console.log(
'Loaded Serviceworker. The serviceworker helps us with notifications and offline capabilities, so you can also read this site when your device is offline.'
);
2019-03-27 13:38:24 +00:00
};
script.src = 'serviceworker/mainthread.js';
document.head.appendChild(script);
};