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
Is it possible to have one shared shadow endpoint for several .svelte pages?
For example, we have public pages: index.svelte, about.svelte, privacy-policy.svelte
And for all these pages need to retrieve identical information from server about the user (logged or not, unreaded messages to show counter, etc)
So, how can we use say index.js endpoint? This filename will work with index.svelte, but not with the others pages. Renaming to [index].js or [...index].js breaks at all.
Current workaround I found is using the 'old' way with load and fetch in all other than index.svelte pages:
I do like this idea, similar to a layout but maybe an __endpoint.js file to load multiple routes with data. I would also love the ability to actually import an endpoint into routes instead of the pure magic load. This would allow the endpoints to be placed away from the routes also.
Describe the problem
Is it possible to have one shared shadow endpoint for several .svelte pages?
For example, we have public pages: index.svelte, about.svelte, privacy-policy.svelte
And for all these pages need to retrieve identical information from server about the user (logged or not, unreaded messages to show counter, etc)
So, how can we use say index.js endpoint? This filename will work with index.svelte, but not with the others pages. Renaming to [index].js or [...index].js breaks at all.
Current workaround I found is using the 'old' way with load and fetch in all other than index.svelte pages:
But I'm not sure how good this solution is.
Describe the proposed solution
Ability to pair one endpoint with many pages. May be with regex like filename:
[index|about|privacy-policy].js
Alternatives considered
No response
Importance
would make my life easier
Additional Information
No response
The text was updated successfully, but these errors were encountered: