Skip to content
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

Provide type abbreviation for promises that reject with Js.Promise.error #71

Open
aantron opened this issue Feb 17, 2021 · 0 comments
Open
Milestone

Comments

@aantron
Copy link
Owner

aantron commented Feb 17, 2021

From Discord:

nitpicking, you could save a line by binding login directly as a reason-promise:

external login: unit => Promise.Js.t(authResponse, Js.Promise.error) = "login"

then you can get rid of the ->Promise.Js.fromBsPromise, which is a no-op at run time anyway.

looking at that, it might be good to add a helper type abbreviaton to the library, so you can do something like

extern login: unit => Promise.Js.raw(authResponse) = "login"
@aantron aantron added this to the 1.2.0 milestone Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant