This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 432
Preload changes #554
Comments
Implemented on master, except for the arity check optimisation. Will add a new issue for that |
I have a feeling that this functionality is scuppered by #415 - since my browser caches the page for 10 minutes, meaning that the page is never hit and thus the preload is never run, regardless of whether session has been changed or not. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
A consequence of the Svelte 3 way of doing things is that we can't pass around
this.store
topreload
functions. Instead, I think it could look like this:This is an opportunity to fix a bug: if you're on a page that redirects to a login page if there's no user object, or otherwise preloads data specific to that user, then logging out won't automatically update the page — you could easily end up with a page like
With this change, we can re-run
preload
when the session store changes, e.g. as a result of something like this in a nav bar:We'd only need to rerun
preload
functions whensession
changed if the function's arity was 2. (A related thought: we need to rerun allpreload
functions whenquery
changes, including for intermediate layout components. But maybe if the object passed in had getters or was a proxy, we could check to see whetherquery
was used, and skip unnecessary preloads to avoid overfetching where possible. But that's a low priority nice-to-have.)Thoughts?
The text was updated successfully, but these errors were encountered: