summaryrefslogtreecommitdiffstats
path: root/src/Types.elm
diff options
context:
space:
mode:
authorJan Tuomi <jan.tuomi@valuemotive.com>2021-10-29 11:15:12 +0300
committerJan Tuomi <jan.tuomi@valuemotive.com>2021-10-29 11:15:12 +0300
commitd0b6988a1a49ae0966e887e892508f2afc12bc6a (patch)
tree3dd4148672d623bb7ec287aed757866d5f97d4b6 /src/Types.elm
Initial commit
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
+ }