mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2025-01-05 12:57:33 +03:00
Add sandbox template constructor.
This commit is contained in:
parent
55f2a4bcd4
commit
59a7402809
@ -8,6 +8,30 @@ import Pages.StaticHttp as StaticHttp
|
||||
import Shared
|
||||
|
||||
|
||||
sandbox :
|
||||
{ view :
|
||||
templateMetadata
|
||||
-> PagePath Pages.PathKey
|
||||
-> Shared.RenderedBody
|
||||
-> Shared.PageView Never
|
||||
, head :
|
||||
templateMetadata
|
||||
-> PagePath Pages.PathKey
|
||||
-> List (Head.Tag Pages.PathKey)
|
||||
}
|
||||
-> TemplateSandbox templateMetadata
|
||||
sandbox config =
|
||||
template
|
||||
{ view =
|
||||
\dynamicPayload allMetadata staticPayload rendered ->
|
||||
config.view staticPayload.metadata staticPayload.path rendered
|
||||
, head = \staticPayload -> config.head staticPayload.metadata staticPayload.path
|
||||
, staticData = \_ -> StaticHttp.succeed ()
|
||||
, init = \_ -> ( (), Cmd.none )
|
||||
, update = \_ _ _ -> ( (), Cmd.none, Shared.NoOp )
|
||||
}
|
||||
|
||||
|
||||
simplest :
|
||||
{ view :
|
||||
List ( PagePath Pages.PathKey, GlobalMetadata.Metadata )
|
||||
@ -127,6 +151,10 @@ type alias Template templateMetadata templateStaticData templateModel templateMs
|
||||
}
|
||||
|
||||
|
||||
type alias TemplateSandbox templateMetadata =
|
||||
Template templateMetadata () () Never
|
||||
|
||||
|
||||
type alias StaticPayload metadata staticData =
|
||||
{ static : staticData
|
||||
, sharedStatic : Shared.StaticData
|
||||
|
Loading…
Reference in New Issue
Block a user