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

fix(types): allow synchronous interceptors to be passed #128

Merged
merged 2 commits into from
Sep 26, 2022

Conversation

yufanzheng0723
Copy link
Contributor

@yufanzheng0723 yufanzheng0723 commented Sep 22, 2022

My English is not good, sorry I used a translator
Hi hello, I am using onRequest in $fetch.create in nuxt3, it throws an error, need to return a Promise? But I don't return anything and it seems to be working fine.
maybe it is possible to use union types to avoid this type error?

resolves #127

@danielroe danielroe changed the title (chores): add union type to onRequest fix(types): allow onRequest to be synchronous Sep 23, 2022
Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

Thank you ❤️

src/fetch.ts Outdated Show resolved Hide resolved
@danielroe danielroe changed the title fix(types): allow onRequest to be synchronous fix(types): allow synchronous interceptors to be passed Sep 23, 2022
@codecov
Copy link

codecov bot commented Sep 23, 2022

Codecov Report

Merging #128 (3ac4fe9) into main (2044bf9) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #128   +/-   ##
=======================================
  Coverage   85.53%   85.53%           
=======================================
  Files           5        5           
  Lines         311      311           
  Branches       60       60           
=======================================
  Hits          266      266           
  Misses         45       45           
Impacted Files Coverage Δ
src/fetch.ts 86.88% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

Thanks!

@pi0 pi0 merged commit 46e8f3c into unjs:main Sep 26, 2022
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.

Hi hello, I am using $fetch.create in nuxt3 using onRequest and it throws me an error
3 participants