mattpocockuk - 1509850662795989005
Last updated
Last updated
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