Module
Concur.Core.Discharge
- Package
- purescript-concur-react
- Repository
- ajnsit/purescript-concur
#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.
- Runs the Effect action
- Forks the Aff action, using an async delay to guarantee that handler will not be called synchronously.
- 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.
- Runs the Effect action
- 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>)
- Extracts and returns the view