generated at
Halogen Componentのcomponent

諸々のパーツを組み合わせてHalogen Componentを作成する


purs(hs)
component :: forall query input output m. H.Component query input output m component = H.mkComponent { initialState , render , eval: H.mkEval $ H.defaultEval { handleAction = handleAction } }



component関数
componentそのもの
型についてはH.Component型を参照
H.mkComponent を使って基本的な構造を作る



H.mkComponent
3つのfieldを持つ
initialState
render
eval
これらのfieldをまとめてComponentSpecと呼ぶ
purs(hs)
type ComponentSpec state query action slots input output m = { initialState :: input -> state , render :: state -> HC.HTML (ComponentSlot slots m action) action , eval :: HalogenQ query action input ~> HalogenM state action slots output m }




eval
5つのfieldを持つ
handleAction
receve
handleQuery
initialize
finalize
purs(hs)
type EvalSpec state query action slots input output m = { handleAction :: action -> HalogenM state action slots output m Unit , handleQuery :: forall a. query a -> HalogenM state action slots output m (Maybe a) , receive :: input -> Maybe action , initialize :: Maybe action , finalize :: Maybe action }
それぞれ何を表す #??