Skip to content

Change import such that TS can infer type#4

Merged
jacobheun merged 1 commit into
jacobheun:masterfrom
Gozala:patch-1
May 25, 2020
Merged

Change import such that TS can infer type#4
jacobheun merged 1 commit into
jacobheun:masterfrom
Gozala:patch-1

Conversation

@Gozala

@Gozala Gozala commented May 25, 2020

Copy link
Copy Markdown
Contributor

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.

@jacobheun jacobheun left a comment

Copy link
Copy Markdown
Owner

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
Copy Markdown
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
Copy Markdown
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