Skip to content

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

Open
@aantron

Description

@aantron

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions