noredink-ui/styleguide-app/Main.elm

33 lines
762 B
Elm
Raw Normal View History

2018-09-26 17:02:10 +03:00
module Main exposing (init, main)
2018-02-13 00:32:38 +03:00
import Browser
import Browser.Navigation exposing (Key)
2018-02-13 00:32:38 +03:00
import Model exposing (..)
import NriModules as NriModules
import Routes as Routes exposing (Route(..))
import Update exposing (Msg(..), subscriptions, update)
import Url exposing (Url)
2018-02-13 00:32:38 +03:00
import View exposing (view)
main : Program () Model Msg
2018-02-13 00:32:38 +03:00
main =
Browser.application
2018-02-13 00:32:38 +03:00
{ init = init
, update = update
, subscriptions = subscriptions
, view = view
, onUrlRequest = OnUrlRequest
, onUrlChange = OnUrlChange
2018-02-13 00:32:38 +03:00
}
init : () -> Url -> Key -> ( Model, Cmd Msg )
2018-12-05 21:56:04 +03:00
init () url key =
( { route = Routes.fromLocation url
2018-02-13 00:32:38 +03:00
, moduleStates = NriModules.init
2018-12-05 21:56:04 +03:00
, navigationKey = key
2018-02-13 00:32:38 +03:00
}
, Cmd.none
)