aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/Update.elm
diff options
context:
space:
mode:
authorJoris2016-03-28 17:51:14 +0200
committerJoris2016-03-28 17:51:14 +0200
commit166cd04e4b28770ede854dafc9ae30eae64102fe (patch)
tree2245a31243a165acc6f7355534da44cfd17e6038 /src/client/elm/Update.elm
parentb0d80a5458d7ba4546e5f01f5b6398ea6d23f981 (diff)
downloadbudget-166cd04e4b28770ede854dafc9ae30eae64102fe.tar.gz
budget-166cd04e4b28770ede854dafc9ae30eae64102fe.tar.bz2
budget-166cd04e4b28770ede854dafc9ae30eae64102fe.zip
Create an empty but reachable user page
Diffstat (limited to 'src/client/elm/Update.elm')
-rw-r--r--src/client/elm/Update.elm21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/client/elm/Update.elm b/src/client/elm/Update.elm
index 5cac028..7d56b36 100644
--- a/src/client/elm/Update.elm
+++ b/src/client/elm/Update.elm
@@ -1,10 +1,15 @@
module Update
- ( update
+ ( routerConfig
+ , update
) where
import Task
import Effects exposing (Effects)
+import TransitRouter
+import RouteParser
+
+import Route exposing (Route)
import Server
@@ -24,6 +29,14 @@ import SignIn.Update as SignInUpdate
import Utils.Http exposing (errorKey)
+routerConfig : TransitRouter.Config Route Action Model
+routerConfig =
+ { mountRoute = \_ _ model -> (model, Effects.none)
+ , getDurations = \_ _ _ -> (50, 200)
+ , actionWrapper = RouterAction
+ , routeDecoder = Maybe.withDefault Route.Home << RouteParser.match Route.matchers
+ }
+
update : Action -> Model -> (Model, Effects Action)
update action model =
case action of
@@ -58,6 +71,12 @@ update action model =
UpdateLoggedIn loggedInAction ->
applyLoggedIn model loggedInAction
+ RouterAction routeAction ->
+ TransitRouter.update
+ routerConfig
+ (Debug.log "routeAction" routeAction)
+ model
+
SignOut ->
( model
, Server.signOut