diff options
Diffstat (limited to 'src/Types.elm')
| -rw-r--r-- | src/Types.elm | 19 |
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 } |
