Navigation überspringen
In TypeScript, interfaces and types are often interchangeable.
0:00 / 1:19

In TypeScript, interfaces and types are often interchangeable.

Cory House

@housecor159.742 Follower

Auf X besuchen

56.144 Aufrufe

In TypeScript, interfaces and types are often interchangeable. But these are 6 features that only work with a type alias. Clip from "TypeScript: Getting Started" on Dometrain

10 Kommentare

Kommentare aus dem Originalbeitrag auf X (Twitter)

  • Profilbild von Cory House

    @housecor

    Full course with a 20% discount:

    6 Likes

  • Profilbild von Tymek Zapała

    @tymzap

    Types are great. I do not see any reason to use interfaces - they have less use cases and brings risk of accidental declaration merging to codebase.

    4 Likes

  • Profilbild von Ryu

    @rmiyazaki3

    Seriously most of what I know about typescript I learned from you and @mattpocockuk

    3 Likes

  • Profilbild von Cory House

    @housecor

    @mattpocockuk Thanks! And yep Matt is a fantastic teacher

    2 Likes

  • Profilbild von tom byrer

    @tombyrer

    The thing I hate about TS is that is lots of programming time that is not programming that significantly moves the needle forward. I hope @typescript team will add auto-typing in Phase 3 of their GoLang transition, or some AI wiz makes a small locally hostable model to do this.

    2 Likes

  • Profilbild von Cory House

    @housecor

    @typescript I find adding types takes little time and tends to “flow” through the code once I’ve delivered the type once. Often mainly need types for the json fetched from APIs

    3 Likes

  • Profilbild von ℤ

    @technically_zac

    1:19 seconds of 🔥🔥🔥

    1 Like

  • Profilbild von Cory House

    @housecor

    Thanks!

    1 Like

  • Profilbild von Friedrich

    @FriedrichC109

    That's why I only use types. There is also interfaces merging that can be misleading

    1 Like

  • Profilbild von Juan Roa

    @jroadev

    Great tips for such commons workarounds while working with TS!

    1 Like