getto-systems/getto-elm-command/1.0.2

Renamed to getto-systems/elm-command. It is published under that name, and new versions come out there.

Versions published as getto-systems/getto-elm-command still install under that name. 3 versions of 3 come from the new location (see their notes).

Rerouted (renamed, verified). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/getto-systems/elm-command.

What we checked: The repo moved to github.com/getto-systems/elm-command. Rebuilt with git archive from commit 29d60d714ef5 of https://github.com/getto-systems/elm-command (zip prefix getto-systems-getto-elm-command-29d60d7/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 3128da56098822c2699ea320ba22b9d717fdaca6.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/getto-systems/getto-elm-command/zipball/1.0.2/

Getto.Command

utility of Cmd

Construction

none : model -> ( model, Cmd msg )

create 'Do nothing' command

model |> Command.none
-- ( model, Cmd.none )

Helper

map : (msg -> super) -> ( model, Cmd msg ) -> ( model, Cmd super )

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 )

Chaining

(model -> ( model, Cmd msg ))
-> ( model, Cmd msg )
-> ( model, Cmd msg )

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 )