blob: 241573344ba2cec2c978e9b6b9e0fce79ef3d388 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
module LoggedIn.Stat.Update exposing
( update
)
import LoggedData exposing (LoggedData)
import LoggedIn.Stat.Model as Stat
import LoggedIn.Stat.Msg as Stat
update : LoggedData -> Stat.Msg -> Stat.Model -> (Stat.Model, Cmd Stat.Msg)
update loggedData msg model =
case msg of
Stat.NoOp ->
( model
, Cmd.none
)
Stat.UpdateChart ->
let { currentTime, paymentCategories, payments } = loggedData
in ( { model
| paymentsByMonthByCategory = Stat.getPaymentsByMonthByCategory currentTime paymentCategories payments
}
, Cmd.none
)
|