mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-26 05:13:24 +03:00
Review fixes.
This commit is contained in:
parent
89bf2b8167
commit
f3170ecb81
@ -1,12 +1,10 @@
|
||||
module RequestsAndPending exposing (RawResponse, RequestsAndPending, Response(..), ResponseBody(..), batchDecoder, bodyEncoder, get)
|
||||
module RequestsAndPending exposing (RawResponse, RequestsAndPending, Response(..), ResponseBody(..), bodyEncoder, get)
|
||||
|
||||
import Base64
|
||||
import Bytes exposing (Bytes)
|
||||
import Codec
|
||||
import Dict exposing (Dict)
|
||||
import Json.Decode as Decode exposing (Decoder)
|
||||
import Json.Encode as Encode
|
||||
import Pages.StaticHttp.Request
|
||||
|
||||
|
||||
type alias RequestsAndPending =
|
||||
@ -20,18 +18,6 @@ type ResponseBody
|
||||
| WhateverBody
|
||||
|
||||
|
||||
batchDecoder : Decoder (List { request : Pages.StaticHttp.Request.Request, response : Response })
|
||||
batchDecoder =
|
||||
Decode.map2 (\request response -> { request = request, response = response })
|
||||
(Decode.field "request"
|
||||
(Pages.StaticHttp.Request.codec
|
||||
|> Codec.decoder
|
||||
)
|
||||
)
|
||||
(Decode.field "response" decoder)
|
||||
|> Decode.list
|
||||
|
||||
|
||||
decoder : Decoder Response
|
||||
decoder =
|
||||
Decode.map2 Response
|
||||
|
Loading…
Reference in New Issue
Block a user