Skip to content

Instantly share code, notes, and snippets.

View jfrolich's full-sized avatar
💭
ReasonML / Elixir

Jaap Frolich jfrolich

💭
ReasonML / Elixir
View GitHub Profile
type t<'a> = Js.Promise.t<'a>
type error
@bs.new
external make: ((@bs.uncurry ~resolve: (. 'a) => unit, ~reject: (. exn) => unit) => unit) => t<'a> =
"Promise"
@bs.val @bs.scope("Promise") external resolve: 'a => t<'a> = "resolve"
@bs.val @bs.scope("Promise") external reject: exn => t<'a> = "reject"
@bs.val @bs.scope("Promise")
external all: array<t<'a>> => t<array<'a>> = "all"