Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change import such that TS can infer type #4

Merged
merged 1 commit into from
May 25, 2020

Conversation

Gozala
Copy link
Contributor

@Gozala Gozala commented May 25, 2020

When this is used from the typescript most things can be inferred, except for AbortController which has it types defined as ES module (see https://github.com/mysticatea/abort-controller/blob/master/dist/abort-controller.d.ts)

TS does not interpret default export as module.exports which leads to problems downstream. This change just uses named import that is also provided abort-controller which resolves all the issues.

Copy link
Owner

@jacobheun jacobheun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 lgtm

@jacobheun jacobheun merged commit 837d688 into jacobheun:master May 25, 2020
@jacobheun
Copy link
Owner

It looks like there is an issue with the abort-controller exports for browsers which causes AbortController to be undefined. https://github.com/mysticatea/abort-controller/blob/master/browser.js#L11-L13 is missing module.exports.AbortController which looks to be causing the issue.

@jacobheun
Copy link
Owner

I created a PR to abort-controller to fix the browser export, mysticatea/abort-controller#22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants