promise icon indicating copy to clipboard operation
promise copied to clipboard

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

Open aantron opened this issue 4 years ago • 0 comments

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 avatar Feb 17 '21 05:02 aantron