From 1e47a7754ca38bd1a6c74765d8378caf68ce4619 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 26 Mar 2017 21:10:42 +0200 Subject: Separate client and server watch --- src/client/Utils/Json.elm | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/client/Utils/Json.elm (limited to 'src/client/Utils/Json.elm') diff --git a/src/client/Utils/Json.elm b/src/client/Utils/Json.elm new file mode 100644 index 0000000..29e815b --- /dev/null +++ b/src/client/Utils/Json.elm @@ -0,0 +1,12 @@ +module Utils.Json exposing + ( dictDecoder + ) + +import Json.Decode as Decode exposing (Decoder) +import Dict exposing (Dict) + +dictDecoder : Decoder comparable -> Decoder a -> Decoder (Dict comparable a) +dictDecoder keyDecoder valueDecoder = + Decode.map2 (,) keyDecoder valueDecoder + |> Decode.list + |> Decode.map Dict.fromList -- cgit v1.2.3