diff options
author | Joris Guyonvarch | 2015-03-21 12:33:58 +0100 |
---|---|---|
committer | Joris Guyonvarch | 2015-03-21 12:33:58 +0100 |
commit | 9e6cf2f2f15b3fef1f99a2fcf980eb96945dc936 (patch) | |
tree | 3e460acb675bf1511baaaa603d1478f6464bba8a /src/Model | |
parent | 11403e9e7a07494d72df0b225216c15724386aa8 (diff) |
Cannot delete a timer if it is the last one
Diffstat (limited to 'src/Model')
-rw-r--r-- | src/Model/Model.elm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Model/Model.elm b/src/Model/Model.elm index b7ac48a..ad1e9da 100644 --- a/src/Model/Model.elm +++ b/src/Model/Model.elm @@ -2,11 +2,13 @@ module Model.Model ( Model , initialModel , substractTimersTime + , numberOfTimers ) where import Dict (Dict) import Dict import Time (Time) +import List import Model.Timer (..) import Model.TimerEdition (..) @@ -33,3 +35,6 @@ initialModel initialTime = substractTimersTime : Time -> Dict Id Timer -> Dict Id Timer substractTimersTime t timers = Dict.map (\id timer -> substractTimerTime t timer) timers + +numberOfTimers : Model -> Int +numberOfTimers = List.length << Dict.toList << .timers |