Module

Halogen.Data.Slot

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

#Slot Source

data 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 (slots :: Row Type) (slot :: (Type -> Type) -> Type -> Type)

#empty Source

empty :: forall slot slots. SlotStorage slots slot

#lookup Source

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

#insert Source

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

#pop Source

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

#slots Source

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

#foreachSlot Source

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