Content pfp
Content
@
0 reply
0 recast
0 reaction

typeof.eth 🔵 pfp
typeof.eth 🔵
@typeof.eth
I've done this before using magic strings, but TIL about `unique symbol` https://www.carlos-menezes.com/post/branded-types
3 replies
0 recast
13 reactions

Phil Cockfield pfp
Phil Cockfield
@pjc
Shit hot, yes yes yes!! Need to wrap my head around this: "A runtime bug is now a compile time bug." This feels related to some new type-ish stuff I've seen where strings (like URI structures) are being type defined and checked, and noted to myself I needed to know how to do this. Seems like this might be how.
0 reply
0 recast
3 reactions

Marc 🎩 🔵 pfp
Marc 🎩 🔵
@mrk
Sounds like something useful for a dependency injection
0 reply
0 recast
2 reactions

Darryl Yeo 🛠️ pfp
Darryl Yeo 🛠️
@darrylyeo
I have mixed feelings about branded types after using them for a year. The added type safety at compile-time is fantastic, but you have to manually cast every single one with `as`, especially when parsing strings from URLs or working with APIs.
1 reply
0 recast
1 reaction