Feature requests: convenience helpers and improved spec compliance
See original GitHub issueSome features that I’d like to contribute from my personal implementation that this one is missing. Opening issue for discussion before just opening a pull request to help eliminate unnecessary work. Some of these are convenience, some of these bring the implementations closer to the Rust spec. Porting these is little effort, as the code already exists in my own personal work.
Convenience helpers
-
function fromPromise<V, E extends Error>(promise: Promise<V>): Promise<Result<V, E>>
; avoids additional microtasks -
function fromSync<V, E extends Error>(func: () => V): Result<V, E>
; synchronous helper, avoids microtasks completely -
Symbol.toStringTag
support; useful to quickly and easily distinguish resulting objects -
Symbol.hasInstance
support onErr
,Ok
,Some
,None
; examplemyResult instance of Err
Spec compliance
- Iterable support, similar to
class Result<T, E extends Error> implements Iterable<T>
-
Result.expectErr
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Feature Requests: What are they and how to manage them
Feature requests are a form of product feedback you may frequently encounter as a SaaS product manager. They typically come in the form...
Read more >Customer Match policy - Advertising Policies Help
Features available to advertisers depend on which requirements your account satisfies: All policy compliant advertisers can use Customer Match and similar ...
Read more >Microsoft 365 guidance for security & compliance
This article provides guidance for Microsoft 365 compliance to help avoid potential service disruption due to unlicensed access.
Read more >How to Manage Product Feature Requests – 6 Best Practices
Managing your feature requests better will help you to: Keep track of product ideas,; Prioritize product features,; Improve your user experience ...
Read more >Using the Feature Request Details Page in Savio
Savio lets you do more than just capture feedback and use it to help you prioritize feature requests. It can also help you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ll add as comments in PR.
Oh sorry! 😆
Yeah if you could provide some snippets that would be great!