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/...

ความคิดเห็น • 5

  • @prashlovessamosa
    @prashlovessamosa ปีที่แล้ว

    Your Vue testing playlist is awesome i learn a lot thank you.

  • @michaelm8044
    @michaelm8044 ปีที่แล้ว +1

    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!

    • @LachlanMiller
      @LachlanMiller  ปีที่แล้ว +2

      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 🙃

    • @michaelm8044
      @michaelm8044 ปีที่แล้ว

      @@LachlanMiller Lol true that

  • @huslerbling
    @huslerbling ปีที่แล้ว

    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 🤔