diff options
author | Joris | 2016-03-28 17:51:14 +0200 |
---|---|---|
committer | Joris | 2016-03-28 17:51:14 +0200 |
commit | 166cd04e4b28770ede854dafc9ae30eae64102fe (patch) | |
tree | 2245a31243a165acc6f7355534da44cfd17e6038 /src/client/elm/Update.elm | |
parent | b0d80a5458d7ba4546e5f01f5b6398ea6d23f981 (diff) |
Create an empty but reachable user page
Diffstat (limited to 'src/client/elm/Update.elm')
-rw-r--r-- | src/client/elm/Update.elm | 21 |
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 |