Fix error in slides project.

This commit is contained in:
Dillon Kearns 2021-04-24 16:10:10 -07:00
parent 38d6b65477
commit 735bdeb2af
4 changed files with 6 additions and 42 deletions

View File

@ -2,7 +2,6 @@ module Page.Slide exposing (Data, Model, Msg, page)
import DataSource
import Document exposing (Document)
import Element exposing (Element)
import Head
import Head.Seo as Seo
import Page exposing (Page, PageWithState, StaticPayload)
@ -24,9 +23,9 @@ type alias RouteParams =
page : Page RouteParams Data
page =
Page.noData
Page.singleRoute
{ head = head
, staticRoutes = DataSource.succeed [ {} ]
, data = DataSource.succeed ()
}
|> Page.buildNoState { view = view }

View File

@ -35,9 +35,9 @@ type alias RouteParams =
page : Page.PageWithState RouteParams Data Model Msg
page =
Page.withData
Page.prerenderedRoute
{ head = head
, staticRoutes =
, routes =
slideCount
|> DataSource.map
(\count ->

View File

@ -1,12 +1,11 @@
module Page exposing
( Builder(..)
, StaticPayload
, withData, noData
, prerenderedRoute, singleRoute
, prerenderedRoute, singleRoute, serverlessRoute
, Page, buildNoState
, PageWithState, buildWithLocalState, buildWithSharedState
, DynamicContext
, serverlessRoute)
)
{-|
@ -32,7 +31,6 @@ But before the user even requests the page, we have the following data:
- `sharedStatic` - we can access any shared data between pages. For example, you may have fetched the name of a blog ("Jane's Blog") from the API for a Content Management System (CMS).
- `static` - this is the static data for this specific page. If you use `noData`, then this will be `()`, meaning there is no page-specific static data.
@docs withData, noData
@docs prerenderedRoute, singleRoute, serverlessRoute
@ -209,39 +207,6 @@ buildWithSharedState config builderState =
}
{-| -}
withData :
{ data : routeParams -> DataSource templateData
, staticRoutes : DataSource (List routeParams)
, head : StaticPayload templateData routeParams -> List Head.Tag
}
-> Builder routeParams templateData
withData { data, head, staticRoutes } =
WithData
{ data = data
, staticRoutes = staticRoutes
, head = head
, serverless = False
, handleRoute = Nothing
}
{-| -}
noData :
{ head : StaticPayload () routeParams -> List Head.Tag
, staticRoutes : DataSource (List routeParams)
}
-> Builder routeParams ()
noData { head, staticRoutes } =
WithData
{ data = \_ -> DataSource.succeed ()
, staticRoutes = staticRoutes
, head = head
, serverless = False
, handleRoute = Nothing
}
singleRoute :
{ data : DataSource data
, head : StaticPayload data {} -> List Head.Tag