the-sett/elm-update-helper/1.0.1

NOTE: this package is not compatible with Elm 0.19.1

Update3

Convenience function for lifting an update function for an inner model and messages, that also returns an additional out parameters into a parent one.

(model -> submodel)
-> (submodel -> model -> model)
-> (submsg -> msg)
-> (submsg -> submodel -> ( submodel, Cmd submsg, outmsg ))
-> submsg
-> model
-> ( model, Cmd msg, outmsg )

Lifts an update function of type:

update : submsg -> submodel -> ( submodel, Cmd submsg, outmsg )

Into one that returns:

(model, Cmd  msg, outmsg)
(outmsg -> model -> ( model, Cmd msg ))
-> ( model, Cmd msg, outmsg )
-> ( model, Cmd msg )

Allows the output of an update function that returns type:

(model, Cmd msg, outmsg)

To have its model and out message evaluated in order to produce a new model, and to create more commands. The commands returned will be appended to those passed in using Cmd.batch.