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

how to replace Axios with another library? #207

Open
gadelkareem opened this issue May 2, 2020 · 5 comments
Open

how to replace Axios with another library? #207

gadelkareem opened this issue May 2, 2020 · 5 comments

Comments

@gadelkareem
Copy link

I am using https://github.com/twg/devour to handle my JSON API requests. How to use it instead of Axios?

@dgrubelic
Copy link
Owner

Hi, unfortunately, this is very small and rather unknown library to be implemented. What I recommend to create wrapper plugin library that will handle sending requests in vue-authenticate. You can even create a plugin, for example vue-authenticate-devour and publish it and I'll be glad to support it officially.

@gadelkareem
Copy link
Author

gadelkareem commented May 2, 2020

That's good to know. Is there an example of a wrapper plugin that I can use? I tried to play with the plugin factory method but could not get through.

@dgrubelic
Copy link
Owner

Unfortunately, no. You'll have to google that yourself. You can check out how I did it here: https://github.com/dgrubelic/vue-authenticate/blob/master/src/index.js#L10 any try to implement it yourself.

@gadelkareem
Copy link
Author

I mean how to inject the $http into vue-authenticate before adding it to Vue plugins?

@ajmas
Copy link

ajmas commented Dec 9, 2021

In Vue2 could probably just do the following:

Vue.prototype.$http = axios.create();

If you replace axios with anything else, you'll just need to make sure the function calls are compatible with the way this package uses it.

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

No branches or pull requests

3 participants