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

What's the point of a wrapper? #31

Closed
EmmanuelBeziat opened this issue Aug 3, 2018 · 3 comments
Closed

What's the point of a wrapper? #31

EmmanuelBeziat opened this issue Aug 3, 2018 · 3 comments

Comments

@EmmanuelBeziat
Copy link

Hi!

I was just wondering what's the point of using a vue wrapper for axios? What is the gain over a simple

import axios from 'axios'

axios.get()

Does having it set in the Vue component allow me to do something useful (for example, easily set some globals : https://github.com/axios/axios#global-axios-defaults)?

Thanks :)

@imcvampire
Copy link
Owner

imcvampire commented Aug 4, 2018

Hi,

I created this library because, in the past, I need a simple solution to migrate from vue-resource to axios.

It has a small benefit that it binds axios to vue instance so you don't have to import every time you use axios. Moreover, it's possible to access it globally (via Vue instance)

@EmmanuelBeziat
Copy link
Author

EmmanuelBeziat commented Aug 4, 2018

Okay, thanks for the explanations! :)

@imcvampire imcvampire mentioned this issue Apr 12, 2019
Closed
@imcvampire imcvampire pinned this issue Apr 12, 2019
@mrcodekiddie
Copy link

😌

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