-
Notifications
You must be signed in to change notification settings - Fork 139
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
Make isRouting more reliable + other fixes #442
Conversation
🦋 Changeset detectedLatest commit: 2f05f37 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
355f55c
to
a22a432
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this inside Mattrax and it seems to be working
Pulled in your improvements, and added a few minor ones on top |
@@ -187,7 +187,7 @@ export function cache<T extends (...args: any) => any>(fn: T, name: string): Cac | |||
return v; | |||
}; | |||
} | |||
}) as CachedFunction<T>; | |||
}) as unknown as CachedFunction<T>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related, but needed for newer typescript versions
Thanks you both. |
I set out to fix #311, but in doing so discovered a few other issues
The isRouting value was not very reliable, and could change many times between true and false
This PR changes
isRouting
to update once to true when routing starts, and then back to false when routing ends - but only after the source has been updated. The ordering will allow one to useisRouting
turning false as a trigger for when it is safe to update your document title. I added tests for these.While doing this I discovered and fixed the following issues:
Question:
I noticed that a transition was started on creation. Is that initial transition important? I currently have it commented out.