janiczek/cmd-extra

DEPRECATED: use Janiczek/cmd-extra (with capitalized 'J')


Install
elm-package install janiczek/cmd-extra 1.0.1

Documentation

Cmd.Extra

Instead of

init : ( Model, Cmd Msg )
init =
    ( myModel, Cmd.none )

write

init : ( Model, Cmd Msg )
init =
    myModel
        |> withNoCmd

And instead of

incrementAndPing : Model -> ( Model, Cmd Msg )
incrementAndPing model =
    ( { model | counter = model.counter + 1 }
    , ping
    )

write

incrementAndPing : Model -> ( Model, Cmd Msg )
incrementAndPing model =
    { model | counter = model.counter + 1 }
        |> withCmd ping