| summaryrefslogtreecommitdiff |
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2022-01-01 16:32:45 +0100 |
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2022-01-01 16:32:45 +0100 |
| commit | f86032ff459f57c8cda368b48888a39c848d263b (patch) | |
| tree | 682ee08cf60baebfc62b3c7cdaf4e715e1bbc635 /src/Comm/LoadStory.elm | |
| parent | 17903cc8333e0f50d3b4e3567f52a8de92101ad3 (diff) | |
Adds JSON decoding.
Diffstat (limited to 'src/Comm/LoadStory.elm')
| -rw-r--r-- | src/Comm/LoadStory.elm | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/Comm/LoadStory.elm b/src/Comm/LoadStory.elm new file mode 100644 index 0000000..869d21b --- /dev/null +++ b/src/Comm/LoadStory.elm @@ -0,0 +1,34 @@ +module Comm.LoadStory exposing (request) + +-- Elm ------------------------------------------------------------------------- +import Http + +-- Tonkadur -------------------------------------------------------------------- +import Tonkadur.Json + +-- Local Module ---------------------------------------------------------------- +import Struct.Event + +-------------------------------------------------------------------------------- +-- TYPES ----------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +-------------------------------------------------------------------------------- +-- LOCAL ----------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +-------------------------------------------------------------------------------- +-- EXPORTED -------------------------------------------------------------------- +-------------------------------------------------------------------------------- +request : String -> (Cmd Struct.Event.Type) +request story_url = + (Http.get + { + url = story_url, + expect = + (Http.expectJson + Struct.Event.LoadStory + (Tonkadur.Json.decoder) + ) + } + ) |


