Formerly getto-systems/getto-elm-command. Search finds this package by either name.
utility fo model -> Cmd msg
set of getter (big -> small) and setter (small -> big -> big)
create 'Do nothing' Transition
construct Prop from getter and setter
type alias Model =
{ name : String
}
name_ = Transition.prop .name (\v m -> { m | name = v })execute Transition
model |> Transition.exec Transition.none
-- ( model, Cmd.none )update small that described by Prop
type alias Model =
{ sub : String
}
sub_ = Transition.prop .sub (\v m -> { m | sub = v })
updateSub model = ( model ++ ", world", Transition.none )
{ sub = "hello" } |> Transition.update sub_ updateSub
-- ( { sub = "hello, world" }, Transition msg )batch Transition
[ Transition.none
, Transition.none
] |> Transition.batchmap ( model, Transition ) tuple
type Msg
= Sub SubMsg
updateSub : model -> ( model, Transition model SubMsg )
model |> updateSub |> Transition.map Sub
-- ( model, Transition model Msg )compose ( model, Transition ) tuples
type alias Model =
{ sub : SubModel
}
Transition.compose
Model
( subModel, Transition.none )compose ( model, Transition ) tuples
type alias Model =
{ sub : SubModel
, other : OtherModel
}
Transition.compose
Model
( subModel, Transition.none )
( otherModel, Transition.none )compose with 3 args
compose with 4 args
compose with 5 args
compose with 6 args
compose with 7 args
compose with 8 args
function of generate
Cmd msgfrom model