-
-
Notifications
You must be signed in to change notification settings - Fork 22
Wait for previous navigation done before navigating to param with new updated value #73
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
Open
TravelingTice
wants to merge
4
commits into
paoloricciuti:master
Choose a base branch
from
TravelingTice:wait_for_earlier_navigation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
1c99087
fix: Wait for previous navigation done before navigating to param wit…
TravelingTice 8c31407
fix: Link unsubbing of store with unsubbing of isNavigating
TravelingTice 4c7d474
test: Add test for the param navigation bug
TravelingTice 3d6e5fe
fix: add ondestroy unsub for param subscribing in playground case
TravelingTice File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Tip
Codebase Verification
The investigation into the usage of
navigating.subscribewithinsrc/lib/sveltekit-search-params.tsreveals that there is indeed an explicit unsubscription mechanism in place within the_setfunction, which addresses the concern about potential memory leaks by ensuring proper cleanup. This demonstrates a level of care in managing subscriptions to thenavigatingstore. However, the initial concern regarding the potential performance impact of multiple subscriptions, especially in applications with frequent navigation updates, remains valid. It's recommended to continue monitoring and optimizing subscription management to thenavigatingstore to mitigate any potential performance issues.Analysis chain
The implementation of subscribing to the
navigatingstore to setisNavigatingbased on the navigation type is a clever way to handle the issue of rapid successive navigation commands. However, there are a couple of points to consider:navigatingstore every time thequeryParamfunction is called could potentially lead to performance issues, especially in applications with frequent navigation updates. It might be more efficient to manage the subscription at a higher level or use a shared state to track navigation status.Consider optimizing the subscription management to the
navigatingstore to improve performance and ensure proper cleanup.Scripts Executed
The following scripts were executed for the analysis:
Script:
Length of output: 194
Script:
Length of output: 785