Error handling de graphql pra front capaz de gerar debate na entrevista kkkkkkkkkkkkkkk
A abordagem do Twitter de usar UnionTypes no response pra erros "de negocio" é interessante, mas nunca vi um projeto usando 100% ainda, nos projetos que trampei só tinham pequenas pocs disso
Let's learn together: Typescript Union Type 🤞
🔀 In TypeScript, a Union Type allows us to declare a variable that could be one of several types. It's like saying, "Hey Typescript, this variable could be a number, a string, or a boolean." #100DaysOfCode#UnionTypes#TypeScript
@vavr_io suporta usar UnionTypes com uma implementação de um Either, que seria tipo o Result que mencionei do Kt ou o Either que o ArrowKt te da. Mas ainda, como o @rponte comentou, cada contexto requer uma saída, Either é legal mas tem horas que complica mais que ajuda
Absolutely. I remember that when I started I created "huge" UnionTypes to have Ruby'ish code until I saw that this could be done more elegant with proper type definitions and overloaded methods (instead the one-method-fits-all-approach).
TypeScript can enhance the experience of developing React components. However, as Paul Burgess explains, in order to fully represent the types of some dynamic components, you need to harness the power of union types. bit.ly/3iTwMBe#TypeScript#UnionTypes#React
TypeScriptのenumを使わないほうがいい理由を、Tree-shakingの観点で紹介します engineering.linecorp.com/ja/…
なるほど、こういう書き方をすればいいのか。単純にUnionTypesで type Status = 'a' | 'b' にするとコード書いてるときの網羅性が若干下がる感じがして嫌だったんだけどそれも解決される文字数