Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Alternative AbortController support (#54)#137

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
prk3 wants to merge2 commits intodevelopit:main
base:main
Choose a base branch
Loading
fromprk3:master

Conversation

prk3
Copy link

Resolves#54.

Alternative solution to#68.
My implementation differs in the following ways:

  • fetch does not override signal's abort handler (one controller can cancel many actions)
  • abort results in rejection with DOMExpection and proper error message.

I polyfilled AbortController and AbortSignal in tests, because they do not exist in node env.

To consider:

  • will addEventListener prevent GC from clearing unused fetch scopes?

Build:

Build "unfetch" to dist:        556 B: unfetch.js.gz        461 B: unfetch.js.br        558 B: unfetch.mjs.gz        464 B: unfetch.mjs.br        629 B: unfetch.umd.js.gz        525 B: unfetch.umd.js.brBuild "unfetch" to polyfill:        559 B: index.js.gz        466 B: index.js.br

sayjeyhi, WesSouza, developit, and niksy reacted with thumbs up emoji
@niksy
Copy link

Any movement on this? What can we do to merge this PR?

One thing that is missing here is check if signal is already aborted so unfetch can reject early, and throwingDOMException won’t work in IE11, so alternative code could be:

try{abortError=newDOMException('Aborted','AbortError');}catch(err){abortError=newError('Aborted');abortError.name='AbortError';}
sayjeyhi reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

add support for aborting via AbortController
3 participants
@prk3@niksy@developit

[8]ページ先頭

©2009-2025 Movatter.jp