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
{{ message }}
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.
The following boilerplate is starting to feel hefty.
if(resultinstanceofError){// ...}else{// ...}
While typing the result as a union avoids the need for a dedicated Result type, it complicates usage of the result. Perhaps the following would be better?
This would allow for much simpler use of the ok value.
if(result.ok){// ...}
This would also enable the removal of intermediate nesting in cases such as entryRead, as we'd no longer need to worry about an any-typed ok resulting in the loss of error type narrowing.
Thoughts?
The text was updated successfully, but these errors were encountered:
The following boilerplate is starting to feel hefty.
While typing the result as a union avoids the need for a dedicated
Result
type, it complicates usage of the result. Perhaps the following would be better?This would allow for much simpler use of the
ok
value.This would also enable the removal of intermediate nesting in cases such as
entryRead
, as we'd no longer need to worry about anany
-typedok
resulting in the loss of error type narrowing.Thoughts?
The text was updated successfully, but these errors were encountered: