the provide/inject is one of the edge cases feature that not recommended to using in common cases according to vue docs
@LachlanMiller3 жыл бұрын
Sure, it definitely has a time and place though - mainly for things you need to be globally available, like the router and your Vuex/Pinia store. But I generally avoid using it, and tend to use props where I can.
@theseangle2 жыл бұрын
@@LachlanMiller imo when you're considering using provide/inject you can always use Pinia instead. Or composables.
@zergzerg4844 Жыл бұрын
I did't get it. In documentation specified than we have to import ref from vue, but i did't see such record in your coed. 4:56 What's the trick?
@adevin91554 жыл бұрын
Thanks for yr videos
@LachlanMiller4 жыл бұрын
thanks for the comment - it means more than you think! it's super hard to get feedback, I appreciate it :D
@aroxing2 жыл бұрын
Thanks for the tutorial. I'm wondering about common patterns of ajax errors and spinner issues. Is there any general pattern to avoid code duplication? Or do I need to copy-paste spinner and error handling code every time I need to add a new AJax query? Maybe you share an example. Thanks in advance.
@jaymartinez3112 жыл бұрын
I’ve bought all your courses and books. Is it posssible you can build a portfolio app? Where i can show my resume, links yo other projects, embed a todo app if possible etc… Like a all in one portfolio site. Thank you for the content. Either in the options or composition api. I learned how to convert from your me or the other.
@LachlanMiller2 жыл бұрын
Are you asking for a video tutorial on how to build a portfolio app? I think this would be definitely doable if you really internal all the content I've produced - I'd recommend you give it a try yourself, happy to take a look at some code if you get stuck.
@vasiliyrusin2 жыл бұрын
I'm really not sure that provide/inject is a good technic that you should use, on our project (which we took from other developers) we tried to remove this pattern because of some troubles which it ships with. It is spaghetti code which I try to avoid for obvious reasons. I'm sure that it's helpful in some utility or magic things such as forms (maybe for validation purposes) but it really shouldn't be a thing that "you should use more often".
@LachlanMiller Жыл бұрын
I agree, I do not use provide/inject outside of writing a third party plugin to throw on npm. I do not use provide/inject in regular apps.
@timmeehan2365 Жыл бұрын
It's actually a pretty useful technique to decouple your components from some implementation details like storage, data provider etc, similar to Providers in Angular or (kind of) Context in React. I agree the name receive is actually much more clear, but they probably used "inject" for dependency injection, which is what it's doing
@rickyu19784 жыл бұрын
How would you do loading state in the router.js file
@LachlanMiller4 жыл бұрын
Going to need some more info, if you can share a code-base and explain what you want I could make a video showing how to do it
@christiann70584 жыл бұрын
Hi Lachlan, would You share the code base of the things You show in this video?
@LachlanMiller4 жыл бұрын
Sure, here you go: github.com/lmiller1990/7-vue-patterns-source
@christiann70584 жыл бұрын
@@LachlanMiller Thanks!
@前端小智3 жыл бұрын
Hi, can I translate the this article into Chinese and share it to more developers? I will write the original author and the address of the article.
@LachlanMiller3 жыл бұрын
Yes, absolutely! Please send me a link when you post it :)