mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-28 06:05:31 +03:00
Remove unused Tuple value in return type.
This commit is contained in:
parent
e61532b73a
commit
1c2629b77e
@ -525,9 +525,7 @@ performStaticHttpRequests allRawResponses secrets staticRequests =
|
||||
-- TODO look for performance bottleneck in this double nesting
|
||||
|> List.map
|
||||
(\( _, request ) ->
|
||||
allRawResponses
|
||||
|> StaticHttpRequest.resolveUrls ApplicationType.Cli request
|
||||
|> Tuple.second
|
||||
StaticHttpRequest.resolveUrls ApplicationType.Cli request allRawResponses
|
||||
)
|
||||
|> List.concat
|
||||
-- TODO prevent duplicates... can't because Set needs comparable
|
||||
|
@ -152,23 +152,21 @@ resolve appType request rawResponses =
|
||||
Ok value
|
||||
|
||||
|
||||
resolveUrls : ApplicationType -> RawRequest value -> RequestsAndPending -> ( Bool, List (Secrets.Value Pages.StaticHttp.Request.Request) )
|
||||
resolveUrls : ApplicationType -> RawRequest value -> RequestsAndPending -> List (Secrets.Value Pages.StaticHttp.Request.Request)
|
||||
resolveUrls appType request rawResponses =
|
||||
case request of
|
||||
RequestError _ ->
|
||||
( False
|
||||
, []
|
||||
-- TODO do I need to preserve the URLs here? -- urlList
|
||||
([]
|
||||
-- TODO do I need to preserve the URLs here? -- urlList
|
||||
)
|
||||
|
||||
Request _ ( urlList, lookupFn ) ->
|
||||
case lookupFn appType rawResponses of
|
||||
nextRequest ->
|
||||
resolveUrls appType nextRequest rawResponses
|
||||
|> Tuple.mapSecond ((++) urlList)
|
||||
urlList ++ resolveUrls appType nextRequest rawResponses
|
||||
|
||||
Done _ _ ->
|
||||
( True, [] )
|
||||
[]
|
||||
|
||||
|
||||
cacheRequestResolution :
|
||||
|
@ -54,8 +54,8 @@ all =
|
||||
, ( get "NEXT", "null" )
|
||||
]
|
||||
)
|
||||
|> Tuple.mapSecond (List.map Secrets.maskedLookup)
|
||||
|> Expect.equal ( True, [ getReq "first", getReq "NEXT" ] )
|
||||
|> List.map Secrets.maskedLookup
|
||||
|> Expect.equal [ getReq "first", getReq "NEXT" ]
|
||||
)
|
||||
, test "andThen staring with done" <|
|
||||
\() ->
|
||||
@ -71,8 +71,8 @@ all =
|
||||
[ ( get "NEXT", "null" )
|
||||
]
|
||||
)
|
||||
|> Tuple.mapSecond (List.map Secrets.maskedLookup)
|
||||
|> Expect.equal ( True, [ getReq "NEXT" ] )
|
||||
|> List.map Secrets.maskedLookup
|
||||
|> Expect.equal [ getReq "NEXT" ]
|
||||
)
|
||||
, test "map" <|
|
||||
\() ->
|
||||
@ -91,8 +91,8 @@ all =
|
||||
, ( get "NEXT", "null" )
|
||||
]
|
||||
)
|
||||
|> Tuple.mapSecond (List.map Secrets.maskedLookup)
|
||||
|> Expect.equal ( True, [ getReq "first", getReq "NEXT" ] )
|
||||
|> List.map Secrets.maskedLookup
|
||||
|> Expect.equal [ getReq "first", getReq "NEXT" ]
|
||||
)
|
||||
, test "andThen chain with 1 response available and 1 pending" <|
|
||||
\() ->
|
||||
@ -108,8 +108,8 @@ all =
|
||||
[ ( get "first", "null" )
|
||||
]
|
||||
)
|
||||
|> Tuple.mapSecond (List.map Secrets.maskedLookup)
|
||||
|> Expect.equal ( False, [ getReq "first", getReq "NEXT" ] )
|
||||
|> List.map Secrets.maskedLookup
|
||||
|> Expect.equal [ getReq "first", getReq "NEXT" ]
|
||||
)
|
||||
, test "andThen chain with 1 response available and 2 pending" <|
|
||||
\() ->
|
||||
@ -130,8 +130,8 @@ all =
|
||||
[ ( get "first", "1" )
|
||||
]
|
||||
)
|
||||
|> Tuple.mapSecond (List.map Secrets.maskedLookup)
|
||||
|> Expect.equal ( False, [ getReq "first", getReq "NEXT" ] )
|
||||
|> List.map Secrets.maskedLookup
|
||||
|> Expect.equal [ getReq "first", getReq "NEXT" ]
|
||||
)
|
||||
]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user