Common Mistakes and Advanced Typescript Techniques

Пікірлер: 21

  • @SuperKidontheblock
    @SuperKidontheblock4 ай бұрын

    Can you imagine having a large object with different fields being returned. Zod is heaven sent.

  • @LjupcheVasilev

    @LjupcheVasilev

    4 ай бұрын

    100%! I don’t use it enough, I use AJV more, but I will be using it for my new side project.

  • @heavierthanlight7173

    @heavierthanlight7173

    3 ай бұрын

    I just made the decision to use Zod inside Typescript projects after I read some really interesting articles on the net.

  • @LjupcheVasilev

    @LjupcheVasilev

    3 ай бұрын

    Let us know how you're finding it after some time :)) @@heavierthanlight7173

  • @heavierthanlight7173

    @heavierthanlight7173

    3 ай бұрын

    @@LjupcheVasilev will do!

  • @bradleyhill5312
    @bradleyhill53124 ай бұрын

    Really great rundown of useful tips for TypeScript! Thanks for the good work!

  • @LjupcheVasilev

    @LjupcheVasilev

    4 ай бұрын

    Glad it was helpful!

  • @nimitsavant3127
    @nimitsavant31274 ай бұрын

    Very descriptive and informational thank you :)

  • @LjupcheVasilev

    @LjupcheVasilev

    4 ай бұрын

    You're very welcome!

  • @ivanlysko6677
    @ivanlysko66772 ай бұрын

    I've been trying to understand the distinctions between using types, enums, and const in TypeScript. Could you shed some light on how they differ and when to use each one?

  • @LjupcheVasilev

    @LjupcheVasilev

    2 ай бұрын

    Types is a way to define what kind of values does the variable hold and it helps with type safety, catching issues while developing etc. For example `const status: string = 'active'` Enums are a way to define a set of named constants. For example when we have a variable of status and we know the status can be Active or Inactive only, that's when enums are most useful. Then these enums can be used to validate the input or whenever we need to use the status we can see which values it can be. Const is just a way to define a constant variable, same as in javascript. Constant means the value of the variable never changes. If the type is an array then we can mutate it like add/remove items but if we define a string we can't reassign it. Hope that helps.

  • @morteza7298
    @morteza72983 ай бұрын

    Great video man, keep going

  • @LjupcheVasilev

    @LjupcheVasilev

    3 ай бұрын

    Thank you!

  • @iUmerFarooq
    @iUmerFarooq4 ай бұрын

    Will you make course on typescript or Vuejs or Nuxtjs or NodeJs ExpressJs or Nestjs or Graphql?

  • @LjupcheVasilev

    @LjupcheVasilev

    4 ай бұрын

    Probably not a whole course soon. But I will continue to make videos on those subjects.

  • @manishgautam2424
    @manishgautam24243 ай бұрын

    That was great , You can deliver much better content , Keep it up

  • @LjupcheVasilev

    @LjupcheVasilev

    3 ай бұрын

    Thank you, glad you like it :)

  • @umaralifayzullayev
    @umaralifayzullayev4 ай бұрын

    Wow this channel is so good 👍 👍 👍

  • @LjupcheVasilev

    @LjupcheVasilev

    4 ай бұрын

    Thank you so much 😀

  • @user-dd7kw3ym5i
    @user-dd7kw3ym5i4 ай бұрын

    I think you don't need to check their types here 2:41 you already have defined types of it so TS will throw an error and you don't have to check it

  • @LjupcheVasilev

    @LjupcheVasilev

    4 ай бұрын

    The reason why I’m checking the types there is because in my types they are set as required properties, but because they are input from the user we can’t be sure the user has actually sent all the required fields. I could’ve made the properties optional and then typescript will complain if they are not checked.