Module

Concur.Core.Discharge

Package
purescript-concur-react
Repository
ajnsit/purescript-concur

#discharge Source

discharge :: forall v a. Monoid v => (Either Error (Widget v a) -> Effect Unit) -> Widget v a -> Effect v

Discharge a widget.

  1. Runs the Effect action
  2. Forks the Aff action
  3. Extracts and returns the view

#dischargePartialEffect Source

dischargePartialEffect :: forall v a. Monoid v => Widget v a -> Effect (Tuple (Widget v a) v)

Discharge only the top level blocking effect of a widget (if any) to get access to the view Returns the view, and the remaining widget

#dischargeAsync Source

dischargeAsync :: forall v a. Monoid v => (Either Error (Widget v a) -> Effect Unit) -> Widget v a -> Effect v

Discharge a widget, forces async resolution of the continuation.

  1. Runs the Effect action
  2. Forks the Aff action, using an async delay to guarantee that handler will not be called synchronously.
  3. Extracts and returns the view

#dischargeSync Source

dischargeSync :: forall v a. Monoid v => (Either Error (Widget v a) -> Effect Unit) -> Widget v a -> Effect v

Discharge a sync widget.

  1. Runs the Effect action
  2. Tries to run the Aff action without forking If it succeeds, then it returns (Left <result>) If it cannot be done, then it returns (Right <remaining Effect action>)
  3. Extracts and returns the view

#ioToIosync Source

ioToIosync :: forall a. Aff a -> Effect (Either a (Aff a))