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
I am trying to load data only once per application instance. Just before the app is initialized. Current infrastructure suggests that I put this logic in the load funciton in the main __layout.svelte. However, it's not ideal when I mix per-layout data and per-app data within one load function. Another issue occures when I am going back and forth beween some __layout and __layout.reset. Those per-app data get loaded again.
Another problem is when I want to keep some components even when I use layout.reset. Notifications component, for example, which stays mounted even when I reset the parent layout.
Describe the proposed solution
I suggest creating one more file [maybe] called __app.svelte which will follow the same logic as __layout.svelte but it will be available only once per app. Either src/app.svelte or src/routes/__app.svelte.
This seems like it's mostly a duplicate of #1165 and #2169, though one part of this request isn't a duplicate:
Another problem is when I want to keep some components even when I use layout.reset. Notifications component, for example, which stays mounted even when I reset the parent layout.
This part of the request is something I haven't seen in any other feature request, to the best of my knowledge.
Describe the problem
I am trying to load data only once per application instance. Just before the app is initialized. Current infrastructure suggests that I put this logic in the
load
funciton in the main__layout.svelte
. However, it's not ideal when I mix per-layout data and per-app data within one load function. Another issue occures when I am going back and forth beween some__layout
and__layout.reset
. Those per-app data get loaded again.Another problem is when I want to keep some components even when I use layout.reset. Notifications component, for example, which stays mounted even when I reset the parent layout.
Describe the proposed solution
I suggest creating one more file [maybe] called
__app.svelte
which will follow the same logic as__layout.svelte
but it will be available only once per app. Eithersrc/app.svelte
orsrc/routes/__app.svelte
.It will sit above all the layouts. Example:
Alternatives considered
Using root-level __layout, however breakes when some __layout.reset is accessed.
Importance
would make my life easier
Additional Information
No response
The text was updated successfully, but these errors were encountered: