Module

Halogen.Data.Slot

Package
purescript-halogen
Repository
purescript-halogen/purescript-halogen

#Slot Source

data Slot :: (Type -> Type) -> Type -> Type -> Typedata Slot (query :: Type -> Type) output slot

A type which records the queries, output messages, and slot identifier for a particular slot (ie. a location in HTML where a component is rendered). For example:

type ButtonSlot slot = Slot Button.Query Button.Output slot

-- A component using this slot type can have one type of child component,
-- which supports `Button.Query` queries, `Button.Output` outputs, and
-- which can be uniquely identified by an integer.
type Slots = ( button :: ButtonSlot Int )
  • query represents the requests that can be made of this component
  • output represents the output messages that can be raised by this component
  • slot represents the unique identifier for this component

#SlotStorage Source

newtype SlotStorage :: Row Type -> ((Type -> Type) -> Type -> Type) -> Typenewtype SlotStorage (slots :: Row Type) (slot :: (Type -> Type) -> Type -> Type)

#empty Source

empty :: forall slots slot. SlotStorage slots slot

#lookup Source

lookup :: forall sym px slots slot query output s. Cons sym (Slot query output s) px slots => IsSymbol sym => Ord s => Proxy sym -> s -> SlotStorage slots slot -> Maybe (slot query output)

#insert Source

insert :: forall sym px slots slot query output s. Cons sym (Slot query output s) px slots => IsSymbol sym => Ord s => Proxy sym -> s -> slot query output -> SlotStorage slots slot -> SlotStorage slots slot

#pop Source

pop :: forall sym px slots slot query output s. Cons sym (Slot query output s) px slots => IsSymbol sym => Ord s => Proxy sym -> s -> SlotStorage slots slot -> Maybe (Tuple (slot query output) (SlotStorage slots slot))

#slots Source

slots :: forall sym px slots slot query output s. Cons sym (Slot query output s) px slots => IsSymbol sym => Ord s => Proxy sym -> SlotStorage slots slot -> Map s (slot query output)

#foreachSlot Source

foreachSlot :: forall m slots slot. Applicative m => SlotStorage slots slot -> (forall query output. slot query output -> m Unit) -> m Unit