pinafore/routes/_utils/loadPolyfills.js

17 lines
604 B
JavaScript
Raw Normal View History

2018-01-28 00:31:26 +00:00
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()
])
}