Renderless Component & Type Safety (Advent of Vue #17)
ฝัง
- เผยแพร่เมื่อ 12 ก.ย. 2024
- My solution to the 17th and final Advent of Vue challenge! Good one to end on - renderless components are a great example of separation of concerns. We also talk about pushing logic out of a component into a stateless function.
I also talk about renderless components in my book: lachlan-miller...
👉 Link to algorithm www.movable-typ...
👉 Haversine formula en.wikipedia.o...
🎄 Advent of Vue: adventofvue.com/
💻 Code: github.com/lmi...
🐦 Keep up with me on Twitter! / lachlan19900
If you like my teaching style, I have a book and two courses!
👀 (Book) Design Patterns for Vue.js: lachlan-miller... (YT_5_OFF for $5 off)
👉 (Course) Vue.js: The Composition API: www.udemy.com/...
🖖 (Course) Complete Vue.js 3: www.udemy.com/...
Your Vue testing playlist is awesome i learn a lot thank you.
I really enjoyed the refactor you did putting it all in one file. Thanks again for another great video. Super easy to follow and comprehensive as usual!
Thanks!
The real solution would be to stop using imperial units, but that's a refactor that will take several centuries, so the best we can do for now is abstract it away into a function 🙃
@@LachlanMiller Lol true that
I’m at bit confused as to why you opted for a headless component instead of a hook. The component you created does nothing but render whatever children it receives. It contains no other markup or styles. I seem to be missing the point here 🤔