summaryrefslogtreecommitdiffstats
path: root/src/Types.elm
diff options
context:
space:
mode:
Diffstat (limited to 'src/Types.elm')
-rw-r--r--src/Types.elm31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/Types.elm b/src/Types.elm
new file mode 100644
index 0000000..de1cccf
--- /dev/null
+++ b/src/Types.elm
@@ -0,0 +1,31 @@
+module Types exposing (..)
+
+
+type alias Model =
+ { posts : List Post
+ , displayError : DisplayableError
+ }
+
+
+type Msg
+ = NoOp
+ | FetchPostsSuccess (List Post)
+ | FetchPostsFailure DisplayableError
+
+
+type DisplayableError
+ = Error String
+ | NoError
+
+
+type alias Author =
+ { id : String
+ , name : String
+ }
+
+
+type alias Post =
+ { id : String
+ , content : String
+ , author : Author
+ }