Module

React.Halo.Internal.Eval

#evalHaloM

evalHaloM :: forall props ctx state action. HaloState props ctx state action -> (HaloM props ctx state action Aff) ~> Aff

Interprets HaloM into the base monad Aff for asynchronous effects.

#evalHaloAp

evalHaloAp :: forall props ctx state action. HaloState props ctx state action -> (HaloAp props ctx state action Aff) ~> ParAff

Interprets HaloAp into the base applicative ParAff for parallel effects.

#evalHaloF

evalHaloF :: forall props ctx state action. HaloState props ctx state action -> (HaloF props ctx state action Aff) ~> Aff

Interprets HaloF into the base monad Aff, keeping track of state in HaloState.

#EvalSpec

type EvalSpec props ctx state action m = { onAction :: action -> HaloM props ctx state action m Unit, onFinalize :: Maybe action, onInitialize :: { context :: ctx, props :: props } -> Maybe action, onUpdate :: { context :: ctx, props :: props } -> { context :: ctx, props :: props } -> Maybe action }

A simpler interface for building the components eval function. The main lifecycle events map directly into actions, so only the action handling logic needs to be written using HaloM.

#defaultEval

defaultEval :: forall props ctx action state m. EvalSpec props ctx state action m

The empty EvalSpec.

#mkEval

mkEval :: forall props ctx state action m. (EvalSpec props ctx state action m -> EvalSpec props ctx state action m) -> Lifecycle props ctx action -> HaloM props ctx state action m Unit

Given an EvalSpec builder, it will return an eval function.

#runAff

runAff :: Aff Unit -> Effect Unit

Simple way to run Aff logic asynchronously, while bringing errors back into Effect.

#runInitialize

runInitialize :: forall props ctx state action. HaloState props ctx action state -> Effect Unit

#handleUpdate

handleUpdate :: forall props ctx state action. HaloState props ctx action state -> props -> ctx -> Effect Unit

#handleAction

handleAction :: forall props ctx state action. HaloState props ctx state action -> action -> Effect Unit

#runFinalize

runFinalize :: forall props ctx state action. HaloState props ctx state action -> Effect Unit

Modules