Yes of course, so for example in one of my early Vue projects where I had no idea what i was doing. I started writing a mixin which handles all of my HTTP requests to firebase.
I noticed in other projects , this was handled much better as plugin instead, this allowed for you to extend the Vue object, so you could do something like this.$http.get() or this.$http.post() etc inside a vue component. This seems a lot cleaner! It's left me wondering in which circumstance would a mixin be better choice over a plugin? like you said, perhaps mixins are going out the door with vue 3?
Ah gotcha! Thanks for clarifying! That's a good question -- I have been avoiding mixins so I'm not sure when it is advantageous π€ Let me dig into it and see what I find π
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yes of course, so for example in one of my early Vue projects where I had no idea what i was doing. I started writing a mixin which handles all of my HTTP requests to firebase.
I noticed in other projects , this was handled much better as plugin instead, this allowed for you to extend the Vue object, so you could do something like
this.$http.get()
orthis.$http.post()
etc inside a vue component. This seems a lot cleaner! It's left me wondering in which circumstance would a mixin be better choice over a plugin? like you said, perhaps mixins are going out the door with vue 3?Ah gotcha! Thanks for clarifying! That's a good question -- I have been avoiding mixins so I'm not sure when it is advantageous π€ Let me dig into it and see what I find π