jxxcarlson/elm-review-codeinstaller/1.1.2

NOTE: the latest version is 13.0.0

Install.Initializer

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
     )
makeRule : String -> String -> String -> String -> Rule

Create a rule that adds a field to the body of a function like init in which 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:

Install.Initializer.makeRule "Backend" "init" "message" "\"hohoho!\""}