isChangingPage Is Set "Too Late"
See original GitHub issueDescription
While trying to use the $isChangingPage
helper, I noticed that it fires “too late”. It won’t set to true
until after the page is already navigated to, which makes it relatively useless. 😞
I believe the issue here is that the value isn’t set to true until after the route’s components have been preloaded…
Would it not make sense to just move the stores.isChangingPage.set(true)
bit to before the route.api.preload()
call? Or, could it not be maybe moved to be set as a hook in the $beforeUrlChange
helper, similar to how its currently set to off in $afterPageLoad
?
Package Versions
$ npm ls --depth=0 @roxi/routify svelte
variedvibe.com@1.0.0 REDACTED
├── @roxi/routify@2.18.4
└── svelte@3.44.3
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How Late is Too Late to Redirect Pages of Domain for SEO
Is it too late to re-redirect the bots. Short answer? No. You are right about redirecting to relevant content. While it has been...
Read more >setState doesn't update the state immediately - Stack Overflow
setState is asynchronous. It means you can't call it on one line and assume the state has changed on the next. According to...
Read more >Start page numbering later in your document - Microsoft Support
Remove the page number from the first page. Go to Insert > Header or Footer > Edit Header or Edit Footer. Select Different...
Read more >How to Change Your Facebook Page URL / Username Easily ...
Wondering how to change your Facebook Page URL? Here's the step-by-step tutorial, plus cautions and troubleshooting tips for changing your ...
Read more >Move a Website and Change URL | Google Search Central
Learn how to change the URLs of existing site pages, including domain name ... the next step is to set up HTTP 301...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @Rican7, moving $isChangingPage would be a breaking change. The helper only shows when a page is actually changing, not when it is loading.
There are a few ways this could be handled:
PR idea 1
We could do something like this instead
PR idea 2
Another option would be to introduce a new Routify option
Alternatively
you could also use a combination of
beforeUrlChange
andafterPageLoad
.I could try and see if I’m able to, yea. 😃