2018-09-26 17:02:10 +03:00
|
|
|
module Main exposing (init, main)
|
2018-02-13 00:32:38 +03:00
|
|
|
|
2018-12-05 01:36:15 +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)
|
2018-12-05 01:36:15 +03:00
|
|
|
import Url exposing (Url)
|
2018-02-13 00:32:38 +03:00
|
|
|
import View exposing (view)
|
|
|
|
|
|
|
|
|
2018-12-05 01:36:15 +03:00
|
|
|
main : Program () Model Msg
|
2018-02-13 00:32:38 +03:00
|
|
|
main =
|
2018-12-05 01:36:15 +03:00
|
|
|
Browser.application
|
2018-02-13 00:32:38 +03:00
|
|
|
{ init = init
|
|
|
|
, update = update
|
|
|
|
, subscriptions = subscriptions
|
2018-12-05 01:36:15 +03:00
|
|
|
, view = view
|
|
|
|
, onUrlRequest = OnUrlRequest
|
|
|
|
, onUrlChange = OnUrlChange
|
2018-02-13 00:32:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-12-05 01:36:15 +03:00
|
|
|
init : () -> Url -> Key -> ( Model, Cmd Msg )
|
2018-12-05 21:56:04 +03:00
|
|
|
init () url key =
|
2018-12-05 01:36:15 +03:00
|
|
|
( { 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
|
|
|
|
)
|