Move value to let.

This commit is contained in:
Dillon Kearns 2022-09-15 13:46:54 -07:00
parent 34f12fa475
commit 2d86d57800

View File

@ -172,6 +172,49 @@ otherFile routes phaseString =
(Type.named [ "ErrorPage" ] "ErrorPage") (Type.named [ "ErrorPage" ] "ErrorPage")
) )
|> topLevelValue "config" |> topLevelValue "config"
globalHeadTags :
{ declaration : Elm.Declaration
, reference : Elm.Expression
, referenceFrom : List String -> Elm.Expression
}
globalHeadTags =
topLevelValue "globalHeadTags"
(Elm.Op.cons
(Elm.value
{ importFrom = [ "Site" ]
, annotation = Nothing
, name = "config"
}
|> Elm.get "head"
)
(Elm.apply
(Elm.value
{ importFrom = [ "Api" ]
, annotation = Nothing
, name = "routes"
}
)
[ getStaticRoutes.reference
, Gen.HtmlPrinter.values_.htmlToString
]
|> Gen.List.call_.filterMap Gen.ApiRoute.values_.getGlobalHeadTagsDataSource
)
|> Gen.DataSource.call_.combine
|> Gen.DataSource.call_.map Gen.List.values_.concat
|> Elm.withType
(Gen.DataSource.annotation_.dataSource
(Type.list Gen.Head.annotation_.tag)
)
)
getStaticRoutes :
{ declaration : Elm.Declaration
, reference : Elm.Expression
, referenceFrom : List String -> Elm.Expression
}
getStaticRoutes =
topLevelValue "getStaticRoutes" todo
in in
Elm.file [ "Main" ] Elm.file [ "Main" ]
[ Elm.alias "Model" [ Elm.alias "Model"
@ -299,42 +342,6 @@ otherFile routes phaseString =
] ]
globalHeadTags =
topLevelValue "globalHeadTags"
(Elm.Op.cons
(Elm.value
{ importFrom = [ "Site" ]
, annotation = Nothing
, name = "config"
}
|> Elm.get "head"
)
(Elm.apply
(Elm.value
{ importFrom = [ "Api" ]
, annotation = Nothing
, name = "routes"
}
)
[ getStaticRoutes.reference
, Gen.HtmlPrinter.values_.htmlToString
]
|> Gen.List.call_.filterMap Gen.ApiRoute.values_.getGlobalHeadTagsDataSource
)
|> Gen.DataSource.call_.combine
|> Gen.DataSource.call_.map Gen.List.values_.concat
|> Elm.withType
(Gen.DataSource.annotation_.dataSource
(Type.list Gen.Head.annotation_.tag)
)
)
getStaticRoutes : { declaration : Elm.Declaration, reference : Elm.Expression, referenceFrom : List String -> Elm.Expression }
getStaticRoutes =
topLevelValue "getStaticRoutes" todo
todo : Elm.Expression todo : Elm.Expression
todo = todo =
Elm.apply (Elm.val "Debug.todo") [ Elm.string "" ] Elm.apply (Elm.val "Debug.todo") [ Elm.string "" ]