Content
@
0 reply
0 recast
0 reaction
typeof.eth 🔵
@typeof.eth
Recently got turned onto ts-pattern. It's a pattern matching library, and it's _really_ nice for doing inline conditional rendering in React code. Ngl, I would mostly use IIFEs before this. Sorry not sorry. But hey, I have a better alternative now. https://github.com/gvergnaud/ts-pattern
2 replies
0 recast
2 reactions
Salief
@salief
I had the repo started, this looks interesting. Is this kind of like switch, case?
1 reply
0 recast
1 reaction
typeof.eth 🔵
@typeof.eth
Yeah, they're definitely similar, but pattern matching is more flexible since you only need to match a part of the target.
0 reply
0 recast
1 reaction