new Polyfill()
Example
await Polyfill.loadAll({ 'fetch': () => import('isomorphic-fetch'), 'Reflect': () => import('harmony-reflect'), 'Array.prototype.find': () => import('array.prototype.find'), 'html-imports': { test() { return !('import' in document.createElement('link')); }, load: () => import('@webcomponents/webcomponentsjs/webcomponents-bundle') } });
Methods
-
<static> load(polyfillId, polyfillConfig)
-
load polyfill
Parameters:
Name Type Description polyfillId
String id of polyfill to load polyfillConfig
Object polyfills config object Returns:
- Type
- Promise
-
<static> loadAll(polyfills)
-
load all polyfills
Parameters:
Name Type Description polyfills
Object polyfills config object Returns:
- Type
- Promis
-
<static> supported(property)
-
test if property is supported by browser/window.
Parameters:
Name Type Description property
String dot notation path of a nested window property. Returns:
- Type
- Boolean