mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2025-01-06 05:34:48 +03:00
Remove unused code.
This commit is contained in:
parent
b10b247d99
commit
9d6502bd4d
@ -7,9 +7,6 @@ import DataSource.Http exposing (RequestDetails)
|
||||
import Dict exposing (Dict)
|
||||
import Dict.Extra
|
||||
import Html exposing (Html)
|
||||
import HtmlPrinter exposing (htmlToString)
|
||||
import Internal.ApiRoute exposing (ApiRoute(..))
|
||||
import Json.Encode
|
||||
import Pages.Internal.NotFoundReason exposing (NotFoundReason)
|
||||
import Pages.SiteConfig exposing (SiteConfig)
|
||||
import Pages.StaticHttp.Request as HashRequest
|
||||
@ -34,41 +31,6 @@ empty =
|
||||
(NotFetched (DataSource.succeed ()) Dict.empty)
|
||||
|
||||
|
||||
buildTimeFilesRequest :
|
||||
{ config
|
||||
| apiRoutes :
|
||||
(Html Never -> String)
|
||||
-> List (ApiRoute.ApiRoute ApiRoute.Response)
|
||||
}
|
||||
-> DataSource (List (Result String { path : List String, content : String }))
|
||||
buildTimeFilesRequest config =
|
||||
config.apiRoutes htmlToString
|
||||
|> List.map
|
||||
(\(ApiRoute handler) ->
|
||||
handler.buildTimeRoutes
|
||||
|> DataSource.andThen
|
||||
(\paths ->
|
||||
paths
|
||||
|> List.map
|
||||
(\path ->
|
||||
handler.matchesToResponse path
|
||||
|> DataSource.map
|
||||
(\maybeResponse ->
|
||||
case maybeResponse of
|
||||
Nothing ->
|
||||
Err ""
|
||||
|
||||
Just response ->
|
||||
Ok { path = path |> String.split "/", content = response |> Json.Encode.encode 0 }
|
||||
)
|
||||
)
|
||||
|> DataSource.combine
|
||||
)
|
||||
)
|
||||
|> DataSource.combine
|
||||
|> DataSource.map List.concat
|
||||
|
||||
|
||||
renderSingleRoute :
|
||||
DataSource a
|
||||
-> DataSource (Maybe NotFoundReason)
|
||||
@ -134,13 +96,6 @@ insertAll newEntries dict =
|
||||
(Dict.update (HashRequest.hash info.request) (\_ -> Just (Just info.response)) dict)
|
||||
|
||||
|
||||
encode : RequestsAndPending -> StaticHttpResult -> RequestsAndPending
|
||||
encode requestsAndPending staticResponses =
|
||||
case staticResponses of
|
||||
NotFetched _ _ ->
|
||||
requestsAndPending
|
||||
|
||||
|
||||
type NextStep route
|
||||
= Continue (Dict String (Maybe String)) (List RequestDetails) (Maybe (List route))
|
||||
| Finish (FinishKind route)
|
||||
|
Loading…
Reference in New Issue
Block a user