Pinafore-Web-Client-Frontend/src/routes/_utils/loadPolyfills.js

16 lines
420 B
JavaScript

import {
importRequestIdleCallback,
importRelativeTimeFormat
} from './asyncPolyfills'
export function loadPolyfills () {
return Promise.all([
typeof requestIdleCallback !== 'function' && importRequestIdleCallback(),
(
typeof Intl.RelativeTimeFormat !== 'function' ||
typeof Intl.Locale !== 'function' ||
typeof Intl.PluralRules !== 'function'
) && importRelativeTimeFormat()
])
}