midas/js/run

Types

pub type Run(a) =
  Promise(Result(a, String))

Functions

pub fn await(
  p: Promise(Result(a, b)),
  then: fn(a) -> Promise(Result(c, b)),
) -> Promise(Result(c, b))
pub fn done(value: a) -> Promise(Result(a, b))
pub fn fail(reason: a) -> Promise(Result(b, a))
pub fn map_error(
  p: Promise(Result(a, b)),
  f: fn(b) -> c,
) -> Promise(Result(a, c))
pub fn try(
  result: Result(a, b),
  then: fn(a) -> Promise(Result(c, b)),
) -> Promise(Result(c, b))
Search Document