summaryrefslogtreecommitdiffstats
path: root/src/Types.elm
diff options
context:
space:
mode:
authorJan Tuomi <jan.tuomi@valuemotive.com>2021-10-29 15:22:52 +0300
committerJan Tuomi <jan.tuomi@valuemotive.com>2021-10-29 15:22:52 +0300
commita972058d20b773f4488df51babb40156c5a335e1 (patch)
tree80b8e18462134da7e5d00a2a32fc25bfd5855667 /src/Types.elm
parentf4dacee4908300f63200864b9f089874152a568c (diff)
Add feed
Diffstat (limited to 'src/Types.elm')
-rw-r--r--src/Types.elm19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/Types.elm b/src/Types.elm
index de1cccf..02e1257 100644
--- a/src/Types.elm
+++ b/src/Types.elm
@@ -1,21 +1,30 @@
module Types exposing (..)
+import Http
+import Time
+
type alias Model =
{ posts : List Post
, displayError : DisplayableError
+ , now : Time.Posix
}
type Msg
= NoOp
- | FetchPostsSuccess (List Post)
- | FetchPostsFailure DisplayableError
+ -- TIME
+ | SetNowPosix Time.Posix
+ -- POSTS
+ | GetPosts
+ | GotPosts (Result Http.Error (List Post))
+ | LikePost Post
+ | LikedPost (Result Http.Error Post)
type DisplayableError
- = Error String
- | NoError
+ = DHttpError Http.Error
+ | DNoError
type alias Author =
@@ -28,4 +37,6 @@ type alias Post =
{ id : String
, content : String
, author : Author
+ , createdAt : Time.Posix
+ , likes : Int
}