mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-27 21:29:55 +03:00
Review fixes.
This commit is contained in:
parent
223f2b69d5
commit
23aa988413
@ -5,7 +5,7 @@ module BackendTask.Http exposing
|
||||
, withMetadata, Metadata
|
||||
, Error(..)
|
||||
, Body, emptyBody, stringBody, jsonBody
|
||||
, CacheStrategy(..), requestWithOptions
|
||||
, CacheStrategy(..), requestWithOptions, Options
|
||||
)
|
||||
|
||||
{-| `BackendTask.Http` requests are an alternative to doing Elm HTTP requests the traditional way using the `elm/http` package.
|
||||
@ -65,7 +65,7 @@ and describe your use case!
|
||||
|
||||
## Caching Options
|
||||
|
||||
@docs CacheStrategy, requestWithOptions
|
||||
@docs CacheStrategy, requestWithOptions, Options
|
||||
|
||||
-}
|
||||
|
||||
@ -210,6 +210,7 @@ expectJson =
|
||||
{-| -}
|
||||
withMetadata : Expect value -> Expect ( Metadata, value )
|
||||
withMetadata originalExpect =
|
||||
-- known-unoptimized-recursion
|
||||
case originalExpect of
|
||||
ExpectJson jsonDecoder ->
|
||||
ExpectMetadata (\metadata -> ExpectJson (jsonDecoder |> Json.Decode.map (Tuple.pair metadata)))
|
||||
@ -227,7 +228,7 @@ withMetadata originalExpect =
|
||||
ExpectMetadata (\metadata -> ExpectWhatever ( metadata, value ))
|
||||
|
||||
ExpectMetadata metadataToExpect ->
|
||||
Debug.todo ""
|
||||
ExpectMetadata (\metadata -> withMetadata (metadataToExpect metadata))
|
||||
|
||||
|
||||
{-| -}
|
||||
@ -244,6 +245,7 @@ expectWhatever =
|
||||
|
||||
expectToString : Expect a -> String
|
||||
expectToString expect =
|
||||
-- known-unoptimized-recursion
|
||||
case expect of
|
||||
ExpectJson _ ->
|
||||
"ExpectJson"
|
||||
@ -353,6 +355,7 @@ encodeOptions options =
|
||||
)
|
||||
|
||||
|
||||
{-| -}
|
||||
type alias Options =
|
||||
{ cacheStrategy : CacheStrategy
|
||||
, retries : Int
|
||||
|
@ -134,14 +134,6 @@ app config =
|
||||
}
|
||||
|
||||
|
||||
batchDecoder : Decode.Decoder (List { request : Pages.StaticHttp.Request.Request, response : RequestsAndPending.Response })
|
||||
batchDecoder =
|
||||
Decode.map2 (\request response -> { request = request, response = response })
|
||||
(Decode.field "request" requestDecoder)
|
||||
(Decode.field "response" RequestsAndPending.decoder)
|
||||
|> Decode.list
|
||||
|
||||
|
||||
mergeResult : Result a a -> a
|
||||
mergeResult r =
|
||||
case r of
|
||||
|
@ -1,4 +1,4 @@
|
||||
module RequestsAndPending exposing (RawResponse, RequestsAndPending, Response(..), ResponseBody(..), batchDecoder, bodyEncoder, decoder, get)
|
||||
module RequestsAndPending exposing (RawResponse, RequestsAndPending, Response(..), ResponseBody(..), batchDecoder, bodyEncoder, get)
|
||||
|
||||
import Base64
|
||||
import Bytes exposing (Bytes)
|
||||
|
Loading…
Reference in New Issue
Block a user