You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
declarefunctionwork(): Result<boolean,void>work().else(true)// And I think it should accept a function as well `.else(() => heavyWork())`
Error:
(property) else: (<T2>(val: T2) => boolean) | (<T2>(val: T2) => T2)
This expression is not callable.
Each member of the union type
'(<T2>(val: T2) => boolean) | (<T2>(val: T2) => T2)' has signatures,
but none of those signatures are compatible with each other.(2349)
I'm not sure how the else functionality was initially designed but it doesn't seem to work at all, at least in TS 3.8+. I know this is more of a typescript issue 33591 or 7294, but imho it should either be removed or a workaround found.
This being said I'd be more than willing to give it a try once I get some time.
Code:
Error:
Playground link
The text was updated successfully, but these errors were encountered: