Formerly getto-systems/getto-elm-command. Search finds this package by either name.
utility of Cmd
map Cmd msg in command tuple
type Msg
= Sub SubMsg
type SubMsg
= HelloWorld
update : Msg -> Model -> ( Model, Cmd Msg )
update message model =
case message of
Sub msg ->
model |> updateSub msg |> Command.map Sub
updateSub : SubMsg -> Model -> ( Model, Cmd SubMsg )
updateSub message model =
case message of
HelloWorld -> ( model, Cmd.none )merge 'Cmd msg' in command tuple
type Msg
= HelloWorld
init : ( Model, Cmd Msg )
init =
( (), Cmd.none )
|> Command.andThen updateA
|> Command.andThen updateB
updateA : ( Model, Cmd Msg )
updateA model = ( model, Cmd.none )
updateB : ( Model, Cmd Msg )
updateB model = ( model, Cmd.none )
create 'Do nothing' command