Add a clause to a case expression in a specified function
in a specified module. For example, if you put the code below in your
ReviewConfig.elm file, running elm-review will add the clause
ResetCounter to the updateFromFrontend function in the Backend module.
-- code for ReviewConfig.elm:
Install.ClauseInCase.makeRule
"Backend"
"updateFromFrontend"
"ResetCounter"
"( { model | counter = 0 }, broadcast (CounterNewValue 0 clientId) )"
Thus we will have
updateFromFrontend : SessionId -> ClientId -> ToBackend -> Model -> ( Model, Cmd BackendMsg )
updateFromFrontend sessionId clientId msg model =
case msg of
CounterIncremented ->
...
ResetCounter ->
( { model | counter = 0 }, broadcast (CounterNewValue 0 clientId) )
Create a rule that adds a clause to a case expression in a specified function