-
Notifications
You must be signed in to change notification settings - Fork 42
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
mahmoud/eng-3688-detecting-the-wallet-api-bitcoin-provider #63
mahmoud/eng-3688-detecting-the-wallet-api-bitcoin-provider #63
Conversation
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.
A few things to look into 😬
|
||
export type Requests = BtcRequests & StxRequests; | ||
|
||
export type Return<Method> = Method extends keyof Requests ? Requests[Method]['result'] : never; |
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's the difference between this and:
export type Return<Method> = Method extends keyof Requests ? Requests[Method]['result'] : never; | |
export type Return<Method extends keyof Requests> = Requests[Method]['result']; |
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.
True, yours is better as you'll get a type warning directly rather than silently accepting the method name with a never result.
* Proposed typing for the result * Remove cancel state
…-bitcoin-provider
|
No description provided.