Skip to content

Commit

Permalink
migrate conditional-polyfills to typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
kroeder committed Feb 16, 2020
1 parent 8b47f1f commit e14292c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/core/src/client/manager/conditional-polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ export const importPolyfills = () => {
if (!window.fetch) {
// manually patch window.fetch;
// see issue: <https://github.com/developit/unfetch/issues/101#issuecomment-454451035>
const patch = ({ default: fetch }) => {
window.fetch = fetch;
};

polyfills.push(import('unfetch/dist/unfetch').then(patch));
// todo needs review
polyfills.push(
import('unfetch').then(res => {
window.fetch = res.default;
})
);
}

return Promise.all(polyfills);
Expand Down

0 comments on commit e14292c

Please sign in to comment.