React.Halo.Internal.Control
- Package
- purescript-react-halo
- Repository
- robertdp/purescript-react-halo
#HaloF Source
data HaloF props ctx state action (m :: Type -> Type) aThe Halo evaluation algebra
propsare the component propsctxis some component contextstateis the component stateactionis the set of actions that the component handlesmis the monad used during evaluationais the result type
Constructors
Props (props -> a)Context (ctx -> a)State (state -> Tuple a state)Subscribe (SubscriptionId -> Emitter action) (SubscriptionId -> a)Unsubscribe SubscriptionId aLift (m a)Par (HaloAp props ctx state action m a)Fork (HaloM props ctx state action m Unit) (ForkId -> a)Kill ForkId a
Instances
#HaloM Source
newtype HaloM props ctx state action (m :: Type -> Type) aThe Halo evaluation monad. It lifts the HaloF algebra into a free monad.
propsare the component propsctxis some component contextstateis the component stateactionis the set of actions that the component handlesmis the monad used during evaluationais the result type
Constructors
Instances
Functor (HaloM props ctx state action m)Apply (HaloM props ctx state action m)Applicative (HaloM props ctx state action m)Bind (HaloM props ctx state action m)Monad (HaloM props ctx state action m)(Semigroup a) => Semigroup (HaloM props ctx state action m a)(Monoid a) => Monoid (HaloM props ctx state action m a)MonadTrans (HaloM props ctx state action)(MonadEffect m) => MonadEffect (HaloM props ctx state action m)(MonadAff m) => MonadAff (HaloM props ctx state action m)MonadState state (HaloM props ctx state action m)MonadRec (HaloM props ctx state action m)(MonadAsk r m) => MonadAsk r (HaloM props ctx state action m)(MonadTell w m) => MonadTell w (HaloM props ctx state action m)(MonadThrow e m) => MonadThrow e (HaloM props ctx state action m)Parallel (HaloAp props ctx state action m) (HaloM props ctx state action m)
#HaloAp Source
newtype HaloAp props ctx state action (m :: Type -> Type) aThe Halo parallel evaluation applicative. It lifts HaloM into a free applicative.
propsare the component propsctxis some component contextstateis the component stateactionis the set of actions that the component handlesmis the monad used during evaluationais the result type
Constructors
Instances
#subscribe Source
subscribe :: forall props ctx state action m. Emitter action -> HaloM props ctx state action m SubscriptionIdSubscribe to new actions from an Emitter. Subscriptions will be automatically cancelled when the component
unmounts.
Returns a SubscriptionId which can be used with unsubscribe to manually cancel a subscription.
#subscribe' Source
subscribe' :: forall props ctx state action m. (SubscriptionId -> Emitter action) -> HaloM props ctx state action m SubscriptionIdSame as subscribe but the event-producing logic is also passed the SuscriptionId. This is useful when events
need to unsubscribe themselves.
#unsubscribe Source
unsubscribe :: forall props ctx state action m. SubscriptionId -> HaloM props ctx state action m UnitCancels the event subscription belonging to the SubscriptionId.
#fork Source
fork :: forall props ctx state action m. HaloM props ctx state action m Unit -> HaloM props ctx state action m ForkIdStart a HaloM process running independantly from the current "thread". Forks are tracked automatically and
killed when the Finalize event occurs (when the component unmounts). New forks can still be created during the
Finalize event, but once evaluation ends there will be no way of killing them.
Returns a ForkId for the new process.