Module

Promise.Aff

Package
purescript-js-promise-aff
Repository
purescript-contrib/purescript-js-promise-aff

#fromAff Source

fromAff :: forall a b. Flatten a b => Aff a -> Effect (Promise b)

Convert an Aff into a Promise.

#toAff Source

toAff :: forall a. Promise a -> Aff a

Convert a Promise into an Aff. When the promise rejects, we attempt to coerce the error value into an actual JavaScript Error object. We can do this with Error objects or Strings. Anything else gets a "dummy" Error object.

#toAff' Source

toAff' :: forall a. (Rejection -> Error) -> Promise a -> Aff a

Convert a Promise into an Aff with custom Error coercion. When the promise rejects, we attempt to coerce the error value into an actual JavaScript Error object using the provided function.

#toAffE Source

toAffE :: forall a. Effect (Promise a) -> Aff a

Utility to convert an Effect returning a Promise into an Aff (i.e. the inverse of fromAff)

Re-exports from Promise

#Promise Source

data Promise t0
Modules
Promise.Aff