Add a field to the body of a function like init in which the
the return value is of the form ( Model, Cmd msg ). As in
the ReviewConfig item below, you specify the module name, the function
name, as well as the field name and value to be added to the function:
-- code for ReviewConfig.elm:
Install.Initializer.makeRule "Backend" "init" "message" "\"hohoho!\""Thus we will have
init : ( Model, Cmd BackendMsg )
init =
( { counter = 0
, message = "hohoho!"
}
, Cmd.none
)
Create a rule that adds a field to the body of a function like
initin which the return value is of the form( Model, Cmd msg ). As in theReviewConfigitem below, you specify the module name, the function name, as well as the field name and value to be added to the function: