pinafore/src/routes/_utils/loadPolyfills.js

16 wiersze
508 B
JavaScript
Czysty Zwykły widok Historia

2018-01-28 00:31:26 +00:00
import {
importIndexedDBGetAllShim,
2018-01-28 00:31:26 +00:00
importIntersectionObserver,
importRequestIdleCallback,
2018-03-21 16:38:20 +00:00
importWebAnimationPolyfill
2018-01-28 00:31:26 +00:00
} from './asyncModules'
2018-02-09 06:29:29 +00:00
export function loadPolyfills () {
2018-01-28 00:31:26 +00:00
return Promise.all([
typeof IntersectionObserver === 'undefined' && importIntersectionObserver(),
typeof requestIdleCallback === 'undefined' && importRequestIdleCallback(),
!Element.prototype.animate && importWebAnimationPolyfill(),
!IDBObjectStore.prototype.getAll && importIndexedDBGetAllShim()
2018-01-28 00:31:26 +00:00
])
2018-02-09 06:29:29 +00:00
}