Let's say I have a function that returns some HTML rendered by Enhance SSR
function (req) {
const html = enhance({
/* ... a lot of config for
elements,
transforms,
and state. */
})
// a bunch of logic based on req
return html`<my-page></my-page>`
}
Can I change initialState on my html method before returning a result?
I could just create the html method later in my function when the initialState is settled, but I may want to actually return early to avoid extra computation and branching logic.
Basically, everything is the same for each invocation of my function, except the state I want to pass to Enhance.
This could also be nice if I want to create html outside of the main function and potentially reuse it in subsequent requests to that function -- thinking about a "warm" Lambda.
Let's say I have a function that returns some HTML rendered by Enhance SSR
Can I change
initialState
on myhtml
method before returning a result?I could just create the
html
method later in my function when the initialState is settled, but I may want to actually return early to avoid extra computation and branching logic.Basically, everything is the same for each invocation of my function, except the state I want to pass to Enhance.
This could also be nice if I want to create
html
outside of the main function and potentially reuse it in subsequent requests to that function -- thinking about a "warm" Lambda.