Content pfp
Content
@
0 reply
0 recast
2 reactions

greg pfp
greg
@gregfromstl
Anyone know how to create an asynchronous type predicate in TS?
2 replies
0 recast
3 reactions

typeof.eth πŸ”΅ pfp
typeof.eth πŸ”΅
@typeof.eth
Just curious, would the async type predicate await the value? There's been a feature request for that that's been open for a few years. https://github.com/microsoft/typescript/issues/37681
1 reply
0 recast
1 reaction

greg pfp
greg
@gregfromstl
Yeah this is exactly what I need. From my (very intermediate) understanding of TS though it's not possible to do safely. TS can't infer an async result without some sort of manual type assertion
1 reply
0 recast
2 reactions