author | handle | source | date |
---|---|---|---|
Matt Pocock 🏖️ |
@mattpocockuk |
2022-04-01 11:10:24 UTC |
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