webbhuset / elm-actor-model-elm-ui / Webbhuset.ElmUI.Component


type alias PID =
Webbhuset.PID.PID

A PID is an identifier for a Process.

Elm UI Components

This module has an identical API to Webbhuset.Component but with the view functions returning Element msg.

Check Webbhuset.Component for more info.


type alias UI model msgIn msgOut =
{ init : PID -> ( model
, List msgOut
, Platform.Cmd.Cmd msgIn )
, update : msgIn -> model -> ( model
, List msgOut
, Platform.Cmd.Cmd msgIn )
, view : model -> Element msgIn
, onSystem : Webbhuset.Component.SystemEvent.SystemEvent -> Webbhuset.Component.SystemEvent.Handling msgIn
, subs : model -> Platform.Sub.Sub msgIn 
}

UI Component Type


type alias Service model msgIn msgOut =
{ init : PID -> ( model
, List msgOut
, Platform.Cmd.Cmd msgIn )
, update : msgIn -> model -> ( model
, List msgOut
, Platform.Cmd.Cmd msgIn )
, onSystem : Webbhuset.Component.SystemEvent.SystemEvent -> Webbhuset.Component.SystemEvent.Handling msgIn
, subs : model -> Platform.Sub.Sub msgIn 
}

Service Component Type


type alias Layout model msgIn msgOut msg =
{ init : PID -> ( model
, List msgOut
, Platform.Cmd.Cmd msgIn )
, update : msgIn -> model -> ( model
, List msgOut
, Platform.Cmd.Cmd msgIn )
, view : (msgIn -> msg) -> model -> (PID -> Element msg) -> Element msg
, onSystem : Webbhuset.Component.SystemEvent.SystemEvent -> Webbhuset.Component.SystemEvent.Handling msgIn
, subs : model -> Platform.Sub.Sub msgIn 
}

Layout Component Type

mapFirst : (input -> out) -> ( input, x, y ) -> ( out, x, y )

Map the first argument (Model).

mapSecond : (input -> out) -> ( x, input, y ) -> ( x, out, y )

Map the second argument (List MsgOut).

mapThird : (input -> out) -> ( x, y, input ) -> ( x, y, out )

Map the third argument (Cmd).

andThen : (model -> ( model, List msgOut, Platform.Cmd.Cmd msgIn )) -> ( model, List msgOut, Platform.Cmd.Cmd msgIn ) -> ( model, List msgOut, Platform.Cmd.Cmd msgIn )

Run a series of updates on the model

addOutMsg : msg -> ( x, List msg, y ) -> ( x, List msg, y )

Add an out message to the output 3-Tuple.

addCmd : Platform.Cmd.Cmd msg -> ( x, y, Platform.Cmd.Cmd msg ) -> ( x, y, Platform.Cmd.Cmd msg )

Add a Cmd to the output 3-Tuple.

toCmd : msg -> Platform.Cmd.Cmd msg

Convert a msg to Cmd.

toCmdWithDelay : Basics.Float -> msg -> Platform.Cmd.Cmd msg

Convert a msg to Cmd with a timeout in milliseconds.


type alias Queue msgIn =
Webbhuset.Component.Queue msgIn

Store messages in a queue.

emptyQueue : Queue msgIn

Create an Empty Queue

addToQueue : msgIn -> Queue msgIn -> Queue msgIn

Add a msg to the queue

runQueue : Queue msgIn -> (msgIn -> model -> ( model, List msgOut, Platform.Cmd.Cmd msgIn )) -> ( model, List msgOut, Platform.Cmd.Cmd msgIn ) -> ( model, List msgOut, Platform.Cmd.Cmd msgIn )

Run the update function on all messages in the queue and compose all output.