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

Feat: Allow users to input their own fetch functions (for proxies) #64

Merged
merged 4 commits into from
Jul 5, 2023

Conversation

OIRNOIR
Copy link
Contributor

@OIRNOIR OIRNOIR commented Jul 4, 2023

You can pass a function that works similarly to the node-fetch fetch function which will be used instead of the node-fetch function.

@changeset-bot
Copy link

changeset-bot bot commented Jul 4, 2023

🦋 Changeset detected

Latest commit: 2c65fa2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
kiai.js Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@what-the-diff
Copy link

what-the-diff bot commented Jul 4, 2023

PR Summary

  • Enhanced KiaiClient.ts and RequestHandler.ts
    The files now import additional components (namely fetch, RequestInfo, and RequestInit) from the "node-fetch" module to extend functionality.

  • Added optional fetchFunction parameter to KiaiClient.ts and RequestHandler.ts constructors
    This parameter will allow for a more advanced and customizable handling of data fetching operations which can prove beneficial in various use cases.

  • Refactored the sendRequest method in RequestHandler.ts
    Now, it utilizes the fetchFunction as its data fetching mechanism instead of the standard fetch method. Again, this allows for more sophisticated and diverse handling of data requests.

@OIRNOIR
Copy link
Contributor Author

OIRNOIR commented Jul 4, 2023

AI is bad

Copy link
Member

@thewilloftheshadow thewilloftheshadow left a comment

Choose a reason for hiding this comment

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

Can you add a changeset please

@OIRNOIR
Copy link
Contributor Author

OIRNOIR commented Jul 5, 2023

@thewilloftheshadow It wants you to approve my commit before merging

@thewilloftheshadow thewilloftheshadow merged commit 7b0ea3a into main Jul 5, 2023
5 checks passed
@OIRNOIR OIRNOIR deleted the oirnoir/feat-custom-fetch-function branch July 5, 2023 14:49
@thewilloftheshadow thewilloftheshadow added the p: kiai.js This is for the kiai.js package label Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p: kiai.js This is for the kiai.js package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants