This library contains some function that make the update and event process with components easier.
Performs the update and handling the events of a component. The event handler can generate new events which can propagated to the host of the host.
import MyComponent -- the client component
import Component -- this library
update : Msg -> Host -> (Host, Cmd Msg, List Event)
update msg host =
case msg of
...
-- call the update manager
WrapMyComponent compMsg ->
Component.updateEvents
MyComponent.update
handleMyCompEvents
.component
(\c h -> { h | component = c })
WrapMyComponent
compMsg
host
...
-- handle all possible events. New events can be generated here.
handleMyCompEvents : Component.Event -> Host -> (Host, Cmd Msg, List Event)
handleMyCompEvents event host =
case event of
...
MyComponent.Event1 -> ...
...
Performs the update and handling the events of a component. In the handling of the events no new events are generated.