module Utils.Cmd exposing ( pipeUpdate , (:>) ) import Platform.Cmd as Cmd pipeUpdate : (model, Cmd msg) -> (model -> (model, Cmd msg)) -> (model, Cmd msg) pipeUpdate (model, cmd) f = let (newModel, newCmd) = f model in (newModel, Cmd.batch [ cmd, newCmd ]) (:>) : (m, Cmd a) -> (m -> (m, Cmd a)) -> (m, Cmd a) (:>) = pipeUpdate infixl 0 :>