-
Notifications
You must be signed in to change notification settings - Fork 16
/
App.elm
48 lines (37 loc) · 1.16 KB
/
App.elm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
module Client.StartTakeHome.App (..) where
import Html exposing (a, div, form, label, input, text, button, Html)
import Html.Attributes exposing (for, id, type', name, action, method, enctype, attribute, href)
import String
import Client.Components exposing (..)
import Shared.Test exposing (..)
import Shared.User exposing (..)
import Shared.Routes exposing (..)
import Client.StartTakeHome.Model exposing (Model)
import Client.StartTakeHome.Update exposing (update, Action(..))
import Client.StartTakeHome.Views exposing (..)
import Effects
import Time exposing (..)
import Telate exposing (loadObject)
import Moment
import StartApp exposing (App, start)
config =
loadObject "TelateProps"
|> Maybe.withDefault
{ user = emptyUser
, test = emptyTestEntry
, currentTime = Moment.getCurrent ()
}
model =
config
app : App Model Action
app =
start
{ init = ( model, Effects.none )
, update = update
, inputs = [ eachSecond ]
}
eachSecond =
every second
|> Signal.map (\_ -> UpdateTime (Moment.getCurrent ()))
main =
Signal.map (viewTakeHome app.address) app.model