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

Add constructor option to allow reusing an axios instance #191

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mikebolt
Copy link

This is for issue #77

This adds the axiosInstance property to the constructor options. This PR also includes some refactoring and new tests.

I added this because some users want the option to reuse another axios instance. The change will make this library compatible with more libraries.

I added tests to ensure that none of the properties of the default request config are changed. This partially addresses npdev453's 2nd point in the issue thread. The baseUrl property is the only one that might be modified, but only when it's undefined.

The documentation needs to be updated to inform the user about potential problems with using the axiosInstance property. It looks like the documentation is separate from this repo, so I can't edit it, but I added the new property to the function documentation.

@sahandsn
Copy link

when will this be applied? we need instances of axios to be used in our project and it seems to be the answer.
specifically we want to convert snake_case and camelCase using axios-case-converter package.

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