Content pfp
Content
@
0 reply
0 recast
2 reactions

Darryl Yeo 🛠️ pfp
Darryl Yeo 🛠️
@darrylyeo
Any TypeScript gurus in the house who can help me troubleshoot this? What am I fundamentally misunderstanding about type parameters / conditionals here?
8 replies
1 recast
11 reactions

Marc BHE Season 🍖☣️ pfp
Marc BHE Season 🍖☣️
@bighamenergy.eth
maybe it's easier to find out with a link from here https://www.typescriptlang.org/play/ but as far as i can read from the images is because is not able to cast the type, possibly because the optionals
1 reply
0 recast
1 reaction

Darryl Yeo 🛠️ pfp
Darryl Yeo 🛠️
@darrylyeo
Playground link is too long for Warpcast... https://warpcast.com/darrylyeo/0x34016cc1
1 reply
0 recast
2 reactions

Marc BHE Season 🍖☣️ pfp
Marc BHE Season 🍖☣️
@bighamenergy.eth
Maybe you need some primitives like predicates. ``` const isTypeA = (x: Type): x is Type.A => x === Type.A ... ``` with that you can do `isTypeA` and will infer the right type will try to see what's with the current snippet and get back to you
1 reply
0 recast
1 reaction