New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Utility class for Result
values
#23059
Conversation
Head branch was pushed to by a user without write access
Result<T, E>
valuesResult
values
🎉 This PR is included in version 35.148.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
interface Ok<T> { | ||
ok: true; | ||
value: T; | ||
} | ||
|
||
interface Err { | ||
ok: false; | ||
error: Error; | ||
} | ||
|
||
type Res<T> = Ok<T> | Err; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zharinov can you please export these types in a new PR, as they are used on public API of Result class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What can go wrong if we don't do this? I'm quite certain these types are kind of private and I designed Result
class to be the only API available here, but what downsides are?
Changes
Context
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: