blob: 8b7944638cee23038ad99e6e7549341026493050 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
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 (model', cmd') = f model
in (model', Cmd.batch [ cmd, cmd' ])
(:>) : (m, Cmd a) -> (m -> (m, Cmd a)) -> (m, Cmd a)
(:>) = pipeUpdate
infixl 0 :>
|