好文章,我喜欢。如果你想多学点这类知识,我推荐 Boris Cherny 写的《Programming TypeScript》(O'Reilly, 2019)以及 Dan Vanderkam 写的《Effective TypeScript》(O'Reilly, 2019)。
Nice article, I like it. I can recommend "Programming TypeScript" by Boris Cherny (O'Reilly, 2019) and "Effective TypeScript" by Dan Vanderkam (O'Reilly, 2019), if you want to learn more like this.
Effective TypeScript [0] has many more well written and explained tips to know to use TypeScript well. I highly recommend it. [0] https://smile.amazon.com/Effective-TypeScript-Specific-Ways-...
可以试试 Dan Vanderkam 的《Effective Typescript: 62 Specific Ways to Improve YourTypeScript》(O'Reilly 出版)。我虽然不是 TS 大佬,但个人觉得它在第一性原理上讲得相当扎实。
Try Dan Vanderkam's "Effective Typescript: 62 Specific Ways to Improve YourTypeScript" (O'Reilly). I'm no TS guru, but IMHO it's pretty well-grounded in first principles.
顺便提一句:Dan Vanderkam 的书《Effective TypeScript: 83 Specific Ways to Improve Your TypeScript》(刚刚出版)已经涵盖了 TypeScript 5.5。就算我写了这么多年 TypeScript,也依然在里面发现了大量非常实用的干货……
btw: Dan Vanderkam's book "Effective TypeScript: 83 Specific Ways to Improve Your TypeScript" (which _just_ released) includes TypeScript 5.5. Even after writing TypeScript for many years I found a lot of really practically applicable stuff in it.…
Try "Effective TypeScript" from O'Reilly, every chapter I've read so far has been informative - even when I thought I knew the topic inside-out - and it's well-written for the subject depth. You can read some of the items on the…
…huge class based hierarchies to make types that work in many situations. Define a minimal interface that you need for a function. Any object that has those properties will type check and work. Check out Effective TypeScript, or Programming TypeScript. As a seasoned node developer I assure you that if you ever have teammates, types will help them contribute to a code base faster and with more confidence.
好文章,我喜欢。如果你想多学点这类知识,我推荐 Boris Cherny 写的《Programming TypeScript》(O'Reilly, 2019)以及 Dan Vanderkam 写的《Effective TypeScript》(O'Reilly, 2019)。
Nice article, I like it. I can recommend "Programming TypeScript" by Boris Cherny (O'Reilly, 2019) and "Effective TypeScript" by Dan Vanderkam (O'Reilly, 2019), if you want to learn more like this.
《Effective TypeScript》[0] 里写了很多非常棒、解释得很透彻的技巧,教你如何用好 TypeScript。我强烈推荐。[0] https://smile.amazon.com/Effective-TypeScript-Specific-Ways-...
Effective TypeScript [0] has many more well written and explained tips to know to use TypeScript well. I highly recommend it. [0] https://smile.amazon.com/Effective-TypeScript-Specific-Ways-...
可以试试 Dan Vanderkam 的《Effective Typescript: 62 Specific Ways to Improve YourTypeScript》(O'Reilly 出版)。我虽然不是 TS 大佬,但个人觉得它在第一性原理上讲得相当扎实。
Try Dan Vanderkam's "Effective Typescript: 62 Specific Ways to Improve YourTypeScript" (O'Reilly). I'm no TS guru, but IMHO it's pretty well-grounded in first principles.
顺便提一句:Dan Vanderkam 的书《Effective TypeScript: 83 Specific Ways to Improve Your TypeScript》(刚刚出版)已经涵盖了 TypeScript 5.5。就算我写了这么多年 TypeScript,也依然在里面发现了大量非常实用的干货……
btw: Dan Vanderkam's book "Effective TypeScript: 83 Specific Ways to Improve Your TypeScript" (which _just_ released) includes TypeScript 5.5. Even after writing TypeScript for many years I found a lot of really practically applicable stuff in it.…
试试 O'Reilly 的《Effective TypeScript》吧,我目前读过的每一章都收获颇丰——哪怕是我以为自己已经彻底吃透的主题也不例外——而且就其主题深度而言,书写得非常好。你可以读读其中的一些条目……
Try "Effective TypeScript" from O'Reilly, every chapter I've read so far has been informative - even when I thought I knew the topic inside-out - and it's well-written for the subject depth. You can read some of the items on the…
……搞出庞大的基于 class 的层级结构来构建适用于各种场景的类型。你只需要为函数定义所需的最小 interface 即可。任何具有这些属性的 object 都能通过类型检查并正常工作。看看《Effective TypeScript》或者《Programming TypeScript》吧。作为一名经验丰富的 Node 开发者,我向你保证,只要你以后有团队成员,类型系统就能帮他们更快、更有信心地向代码库贡献代码。
…huge class based hierarchies to make types that work in many situations. Define a minimal interface that you need for a function. Any object that has those properties will type check and work. Check out Effective TypeScript, or Programming TypeScript. As a seasoned node developer I assure you that if you ever have teammates, types will help them contribute to a code base faster and with more confidence.