u/mirpetriin r/typescript • Recommends
On “Trying to make a function which returns an intersection type bsaed on the arguments”
I had no idea there is this co/contra/bi/in-variance thing going on in typescript:
link to this video
#variance#covariance#contravariance
28K subscribers • 2 videos on Hallway
Advanced. Deep dive for people who know the field.
3.3K views5 years ago2 recommendations
Programming languagesComputer scienceTypeScriptComputation and complexity
Tițian Cericova-Dragomir explains covariance, contravariance, bivariance, and invariance within the TypeScript type system.
◭ Ever wondered why Array is assignable to Array, even though that doesn’t really seem safe? Have you seen the term ‘variance’ thrown around by TypeScript people, but haven’t gotten around to researching what that is? Then this is the talk for you! We will take a deep dive into the type system, understand the other way TypeScript determines assignability. We will start with the basics of what variance is, and then we will see how it impacts every aspect of the type system. ◭ Tițian Cericova-Dragomir (@TitianCernicova) is an engineer at Bloomberg, working on TypeScript and JavaScript infrastructure. He is a TypeScript compiler contributor, as well as one of the top answerers with regard to TypeScript on Stack Overflow. Also, he is a huge fan of TypeScript, and he will try to convince you that you should be one too. ✨ Join our Prisma Meetup group here: meetup.com/TypeScript-Berlin/ ------------------------ Next: 👉 Check Next video: PropTypes vs TypeScript - youtu.be/kOB0PcVEuZg 👉 Check Previous video: Elm in TypeScript, pattern matching and beyond - youtu.be/OXzIZZDq2hE ------------------------ 📚 Resources: ✅ Subscribe to Prisma: youtube.com/channel/UCptAHlN1gdwD89tFM3ENb6w?sub_confirmatio… ✅ Learn more about Prisma: ◭ Website: prisma.io ◭ Docs: prisma.io/docs ◭ Quickstart: pris.ly/qstart ------------------------ 💬 Connect with Prisma: Twitter: twitter.com/prisma Discord: pris.ly/discord LinkedIn: linkedin.com/company/prisma-io/What people say. Highly recommended by engineers as an excellent, deep-dive explanation of variance in TypeScript.
u/mirpetriin r/typescript • Recommends
On “Trying to make a function which returns an intersection type bsaed on the arguments”
Alexander Nenashevon Stack Overflow • Recommends
On “TypeScript allows passing Readonly<T> to a mutating function”