pinafore/routes/_utils/loadPolyfills.js
Nolan Lawson e21224067b refactor
2018-01-27 16:31:26 -08:00

17 lines
604 B
JavaScript

import {
importURLSearchParams,
importIntersectionObserver,
importRequestIdleCallback,
importIndexedDBGetAllShim,
importDialogPolyfill
} from './asyncModules'
export function loadPolyfills() {
return Promise.all([
typeof URLSearchParams === 'undefined' && importURLSearchParams(),
typeof IntersectionObserver === 'undefined' && importIntersectionObserver(),
typeof requestIdleCallback === 'undefined' && importRequestIdleCallback(),
!IDBObjectStore.prototype.getAll && importIndexedDBGetAllShim(),
typeof HTMLDialogElement === 'undefined' && importDialogPolyfill()
])
}