You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes you need to refresh "a global object" which was passed from layout.server but the refresh needs to happen from an children server load function/page.server endpoint (or to be more precise: should be triggered when a children endpoint is called).
Now, you can do this only with a full page reload or not using layout.server but ensuring that the object is sent with every endpoint/sever load func.
Describe the proposed solution
Option A, either some flag on the server load functions which let layout.server rerun
Option B, we can let hook.server pass stuff directly through the endpoints without manually passing stuff: locals.stuff in the server load func response
B should be actually covered by layouts (but, again, which do not rerun), so A might be more intuitive
Alternatives considered
No response
Importance
would make my life easier
Additional Information
No response
The text was updated successfully, but these errors were encountered:
mostrecent
changed the title
page.server endpoints/serveer load functions can't trigger a layout.server rerun and refresh $page on the client
page.server endpoints/server load functions can't trigger a layout.server rerun and refresh $page on the client
Dec 20, 2023
I found that I can let layout.server rerun with adding await parent() to the children endpoints. But it does not change $page on the client in case the rerun gave new values. only those new from the children endpoint are populated in $page while those from layout stay the same from the first run
Describe the problem
Sometimes you need to refresh "a global object" which was passed from layout.server but the refresh needs to happen from an children server load function/page.server endpoint (or to be more precise: should be triggered when a children endpoint is called).
Now, you can do this only with a full page reload or not using layout.server but ensuring that the object is sent with every endpoint/sever load func.
Describe the proposed solution
Option A, either some flag on the server load functions which let layout.server rerun
Option B, we can let hook.server pass stuff directly through the endpoints without manually passing stuff: locals.stuff in the server load func response
B should be actually covered by layouts (but, again, which do not rerun), so A might be more intuitive
Alternatives considered
No response
Importance
would make my life easier
Additional Information
No response
The text was updated successfully, but these errors were encountered: