@constela/server 14.0.2 → 14.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +12 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -802,7 +802,12 @@ async function renderPortal(node, ctx) {
|
|
|
802
802
|
async function renderLocalState(node, ctx) {
|
|
803
803
|
const localStateValues = {};
|
|
804
804
|
for (const [name, field] of Object.entries(node.state)) {
|
|
805
|
-
|
|
805
|
+
const initial = field.initial;
|
|
806
|
+
if (initial && typeof initial === "object" && "expr" in initial) {
|
|
807
|
+
localStateValues[name] = evaluate(initial, ctx);
|
|
808
|
+
} else {
|
|
809
|
+
localStateValues[name] = initial;
|
|
810
|
+
}
|
|
806
811
|
}
|
|
807
812
|
const childCtx = {
|
|
808
813
|
...ctx,
|
|
@@ -1620,7 +1625,12 @@ async function renderPortalToStream(node, ctx) {
|
|
|
1620
1625
|
async function renderLocalStateToStream(node, ctx) {
|
|
1621
1626
|
const localStateValues = {};
|
|
1622
1627
|
for (const [name, field] of Object.entries(node.state)) {
|
|
1623
|
-
|
|
1628
|
+
const initial = field.initial;
|
|
1629
|
+
if (initial && typeof initial === "object" && "expr" in initial) {
|
|
1630
|
+
localStateValues[name] = evaluate2(initial, ctx);
|
|
1631
|
+
} else {
|
|
1632
|
+
localStateValues[name] = initial;
|
|
1633
|
+
}
|
|
1624
1634
|
}
|
|
1625
1635
|
const childCtx = {
|
|
1626
1636
|
...ctx,
|