Pinafore-Web-Client-Frontend/templates/main.js

21 lines
804 B
JavaScript
Raw Normal View History

2018-01-15 02:13:42 +01:00
import { init } from 'sapper/runtime.js'
2018-01-19 08:37:43 +01:00
import { offlineNotifiction } from '../routes/_utils/offlineNotification'
import { serviceWorkerClient } from '../routes/_utils/serviceWorkerClient'
2018-01-19 06:25:12 +01:00
2018-01-17 09:06:24 +01:00
import {
importURLSearchParams,
importIntersectionObserver,
2018-01-19 05:57:15 +01:00
importRequestIdleCallback,
2018-01-19 08:37:43 +01:00
importIndexedDBGetAllShim
2018-01-17 09:06:24 +01:00
} from '../routes/_utils/asyncModules'
2018-01-07 00:51:25 +01:00
2018-01-08 08:00:15 +01:00
// polyfills
Promise.all([
typeof URLSearchParams === 'undefined' && importURLSearchParams(),
2018-01-17 09:06:24 +01:00
typeof IntersectionObserver === 'undefined' && importIntersectionObserver(),
2018-01-19 05:57:15 +01:00
typeof requestIdleCallback === 'undefined' && importRequestIdleCallback(),
!IDBObjectStore.prototype.getAll && importIndexedDBGetAllShim()
2018-01-08 08:00:15 +01:00
]).then(() => {
// `routes` is an array of route objects injected by Sapper
init(document.querySelector('#sapper'), __routes__)
2018-01-19 08:37:43 +01:00
})