mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-26 07:04:33 +03:00
33 lines
762 B
Elm
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
|
|
)
|