From 166cd04e4b28770ede854dafc9ae30eae64102fe Mon Sep 17 00:00:00 2001 From: Joris Date: Mon, 28 Mar 2016 17:51:14 +0200 Subject: Create an empty but reachable user page --- src/client/elm/Update.elm | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/client/elm/Update.elm') 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 -- cgit v1.2.3