noredink-ui/styleguide-app/Main.elm
2018-12-11 21:57:06 +01:00

33 lines
762 B
Elm

module Main exposing (init, main)
import Browser
import Browser.Navigation exposing (Key)
import Model exposing (..)
import NriModules as NriModules
import Routes as Routes exposing (Route(..))
import Update exposing (Msg(..), subscriptions, update)
import Url exposing (Url)
import View exposing (view)
main : Program () Model Msg
main =
Browser.application
{ init = init
, update = update
, subscriptions = subscriptions
, view = view
, onUrlRequest = OnUrlRequest
, onUrlChange = OnUrlChange
}
init : () -> Url -> Key -> ( Model, Cmd Msg )
init () url key =
( { route = Routes.fromLocation url
, moduleStates = NriModules.init
, navigationKey = key
}
, Cmd.none
)