Type Narrowing in TypeScript

Поділитися
Вставка
  • Опубліковано 19 лис 2024

КОМЕНТАРІ • 27

  • @ffedchik
    @ffedchik 2 роки тому +8

    This man deserves a massive respect! Appreciate the content you are sharing with us.

    • @aram5642
      @aram5642 2 роки тому

      Besides all, I love Andrew's well-articulated English at a very natural pace. Pleasure to listen to.

  • @Nscb1947
    @Nscb1947 Рік тому

    I went through many blogs and videos for type narrowing but none explained the way you did. This was absolute gold. Thank you.

  • @GameKornel
    @GameKornel 2 роки тому +3

    Love the exhaustive switch trick! Great video!

  • @sufyankhatri1
    @sufyankhatri1 11 місяців тому

    Great explanation. You delivered it perfectly thank you for the upload

  • @abhirammadhu2973
    @abhirammadhu2973 Рік тому

    This video is a gem😍. I always found it difficult to understand type predicates until you showed this brilliant example. Especially that part (6:10) where you showed that within the predicate the type has been narrowed down😊

  • @aram5642
    @aram5642 2 роки тому +1

    I started to receive your videos among YT suggestion. And this is one of those moments when you really love those algorithms. Thanks for sharing your knowledge! Helps a lot. If you're open for a suggestion though... Please reduce the area with you face in favor of the coding area. May sound harsh, but it is nothing personal. On small mobile screens it is just very hard to follow the typing even in full screen. Thanks again.

    • @andrew-burgess
      @andrew-burgess  2 роки тому +1

      Thanks for watching! And thanks for the feedback! I’ll play around with several ways to make the text bigger 👍

  • @MindlessTurtle
    @MindlessTurtle Рік тому

    Awesome video. Very educational.

  • @alessandroferrari2166
    @alessandroferrari2166 2 роки тому +2

    your explanations are very clear and to the point, thank you! Just as suggestion, you might want to tone down the music or change it altogether. At least for me, it's annoying, not sure for others. Anyway, keep up the great work and subscribed (also to the notifications)!

    • @andrew-burgess
      @andrew-burgess  2 роки тому

      Thanks for the feedback! Still trying to figure out what works best for the music, will be sure to experiment with quieter / no music. Appreciate you subscribing!

  • @MauroGestoso
    @MauroGestoso 2 роки тому

    Great video, Andrew! I'm looking for ammunition to justify starting using TS at work and this will be very helpful. Doing all this defensive programming in vanilla JS is such a pain and so hard to enforce consistently.

  • @qkqk4317
    @qkqk4317 2 роки тому

    Any time you upload our codebase becomes a bit more legible. The exhaustive switch case is a great way to catch issues before the runtime. Gonna be removing a lot of throw statements tomorrow. Great stuff!

    • @andrew-burgess
      @andrew-burgess  2 роки тому

      That means so much to me, so excited that you are finding these videos useful! If you topics that you’d like me to cover, don’t hesitate to let me know!

  • @venzkie89
    @venzkie89 2 роки тому

    Very well explained! 👏👏👏

  • @edgarabgaryan8989
    @edgarabgaryan8989 2 роки тому

    i have learned some new stuff! thanks!

  • @Fishamble
    @Fishamble Рік тому +1

    Great content. Have a comment for the algorithm.

  • @benjamin-lieb
    @benjamin-lieb 11 місяців тому

    Excellent!

  • @rishabhnehra1471
    @rishabhnehra1471 11 місяців тому

    Great video

  • @aram5642
    @aram5642 2 роки тому +2

    Just curious. One could probably use 'interface' + 'extends' to achieve what you achieved with 'type' + &. Am I correct? If so, is this just a matter of preference, or is there a subtle difference between those two options?

    • @andrew-burgess
      @andrew-burgess  2 роки тому

      Good question! I’m actually working on a video about the differences between type and interface right now!

  • @Elator11777
    @Elator11777 Рік тому +1

    Nice watch on your wrist.

  • @nomadshiba
    @nomadshiba 2 роки тому +1

    can also use instanceof of classes

  • @programacion3694
    @programacion3694 Рік тому

    buen video.

  • @Funhouse4420
    @Funhouse4420 2 роки тому

    Great tutorial. Please make the editor larger in new videos. Thanks

    • @andrew-burgess
      @andrew-burgess  2 роки тому

      Thanks for watching, and thanks for the feedback! I’ll make sure the font is more readable in the future.

  • @sam.kendrick
    @sam.kendrick Рік тому +2

    Thanks for the information. I took some notes here: docs.google.com/document/d/e/2PACX-1vSsm6Kqgi2I7q87U_zGXvpnyH6eOHuDYX2_GFwvi0-MyBPvmWz9GD5D30ignJAUw0JJr2-PvEKmY5lC/pub