Store and load client settings

This commit is contained in:
Eike Kettner
2021-05-26 01:14:30 +02:00
parent 9f76357879
commit 9ccc3ce438
10 changed files with 309 additions and 245 deletions

View File

@ -1,6 +1,7 @@
module Util.Update exposing
( andThen1
, andThen2
, andThen3
, cmdUnit
)
@ -44,6 +45,21 @@ andThen2 fs m =
|> combine
andThen3 :
List (model -> { x | model : model, cmd : Cmd msg, sub : Sub msg })
-> model
-> ( model, Cmd msg, Sub msg )
andThen3 list m =
let
mkTuple r =
( r.model, r.cmd, r.sub )
list2 =
List.map (\e -> e >> mkTuple) list
in
andThen2 list2 m
cmdUnit : a -> Cmd a
cmdUnit a =
Task.perform (\_ -> a) (Task.succeed ())