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

Use a custom undici instance #192

Closed
2 tasks done
dnlup opened this issue Sep 20, 2021 · 4 comments · Fixed by #201
Closed
2 tasks done

Use a custom undici instance #192

dnlup opened this issue Sep 20, 2021 · 4 comments · Fixed by #201

Comments

@dnlup
Copy link
Contributor

dnlup commented Sep 20, 2021

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

🚀 Feature Proposal

👋🏻 Thank you for this awesome package! I was thinking that it could be useful to allow to pass a custom undici instance in addition to or as an alternative to the custom options already available. WDYT?

Motivation

The first 2 reasons that come to mind are:

  • use a mockedClient in tests
  • re-use an instance already initialised in the app

Example

No response

@mcollina
Copy link
Member

Sure, good idea! Would you like to send a PR?

@dnlup
Copy link
Contributor Author

dnlup commented Sep 20, 2021

Yes, I'll work on it 😉

@simonecorsi
Copy link

Following, let me know if you need some help!

@dnlup
Copy link
Contributor Author

dnlup commented Sep 28, 2021

I was thinking about using an option called instance in the undici object. Otherwise the undici key could point to the instance, but it would complicate the checks done in buildRequest.

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 a pull request may close this issue.

3 participants