Created
March 2, 2019 02:41
-
-
Save ababup1192/87bc251b826e4803414d924b82e28343 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
continuousIncrementDecrement : Msg -> Int -> Model -> Model | |
continuousIncrementDecrement msg num currentCounter = | |
List.foldl (\_ cc -> update msg cc |> Tuple.first) currentCounter (List.repeat num ()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
continuousIncrementDecrement : Msg -> Int -> Model -> Model | |
continuousIncrementDecrement msg num currentCounter = | |
let | |
nextCounter = | |
update msg currentCounter |> Tuple.first | |
in | |
if num == 0 then | |
currentCounter | |
else | |
continuousIncrementDecrement msg (num - 1) nextCounter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment