mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-23 22:26:16 +03:00
Fix error in slides project.
This commit is contained in:
parent
38d6b65477
commit
735bdeb2af
@ -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 }
|
||||
|
||||
|
@ -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 ->
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user