mattpocockuk - 1509850662795989005

mattpocockuk Matt Pocock 🏖️ (@mattpocockuk) - April 1, 2022 at 7:10 PM

🔥 TypeScript Tip #15 🔥

You can use generics to dynamically specify the number, and type, of arguments to functions.

Here, we create a sendEvent function which only asks for a payload if it's present on the event you're sending. pic.twitter.com/vvhYrBX0nR

https://user-images.githubusercontent.com/870029/206737480-2ee2dfe6-b892-446a-8635-aceb814efaa1.mp4

Download mp4

Tweet link

Thread by @mattpocockuk on Threadify Reader App

Last updated