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 polyfillIdString id of polyfill to load polyfillConfigObject polyfills config object Returns:
- Type
- Promise
-
<static> loadAll(polyfills)
-
load all polyfills
Parameters:
Name Type Description polyfillsObject polyfills config object Returns:
- Type
- Promis
-
<static> supported(property)
-
test if property is supported by browser/window.
Parameters:
Name Type Description propertyString dot notation path of a nested window property. Returns:
- Type
- Boolean