1
0
mirror of https://github.com/nolanlawson/pinafore synced 2024-12-11 09:45:24 +01:00
Pinafore-Web-Client-Frontend/routes/_utils/loadPolyfills.js

16 lines
508 B
JavaScript
Raw Normal View History

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