-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gatsby-link determine when loading is complete #2906
Comments
Not right now. What is your use case for wanting to know when loading is complete? |
I've updated to the latest gatsby-link version where data is preloaded if the link is in the viewport so this is less of an issue now. Before after clicking a link there was a significant wait before displaying the page and I wanted to show a loader. This would still be a useful thing to do and I have implemented at the moment as follows in my
|
Ah interesting — yeah exposing the emitter could be interesting too at some point. I like to be cautious though about making APIs public as they're fairly set in stone at that point. You might want to look at the source of https://www.gatsbyjs.org/packages/gatsby-plugin-nprogress/ as well. Good to hear that avoiding preloading links if not in the viewport made a noticeable improvement! |
Ah, good to know I was on the right track! I'll use the Makes sense regarding exposing APIs as well. |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues as many of them have already been resolved with the latest updates or explained in a previous issue. Feel free to open a new one if you still experience this problem or a similar one! 👍 |
Does
gatsby-link
provide any sort of event or callback that I can use to determine when the load for the code chunks for the incoming page has completed? Gatsby seems to use a global___loader
instance to manage this, but this doesn't seem to have any documentation. Can I useonPostLoadPageResources
somehow?The text was updated successfully, but these errors were encountered: