summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-09-13 16:51:08 +0200
committernsensfel <SpamShield0@noot-noot.org>2018-09-13 16:51:08 +0200
commit9ec5806bc721734923ff4c93f7ef1f97a6a03248 (patch)
treec80b737a8bf0cc6e311c4fe7256f68e7ea8e158a /src/Struct/Event.elm
Starting an browser extension for TO...
Diffstat (limited to 'src/Struct/Event.elm')
-rw-r--r--src/Struct/Event.elm25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Struct/Event.elm b/src/Struct/Event.elm
new file mode 100644
index 0000000..419ef51
--- /dev/null
+++ b/src/Struct/Event.elm
@@ -0,0 +1,25 @@
+module Struct.Event exposing (Type(..), attempted)
+
+-- Elm -------------------------------------------------------------------------
+import Http
+
+-- Main Menu -------------------------------------------------------------------
+import Struct.Error
+import Struct.ServerReply
+import Struct.UI
+
+--------------------------------------------------------------------------------
+-- TYPES -----------------------------------------------------------------------
+--------------------------------------------------------------------------------
+type Type =
+ None
+ | Failed Struct.Error.Type
+ | ServerReplied (Result Http.Error (List Struct.ServerReply.Type))
+ | TabSelected Struct.UI.Tab
+
+attempted : (Result.Result err val) -> Type
+attempted act =
+ case act of
+ (Result.Ok _) -> None
+ (Result.Err msg) ->
+ (Failed (Struct.Error.new Struct.Error.Failure (toString msg)))