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