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