Skip to content
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

fix: use_route should subscribe to changes to the route #168

Merged
merged 4 commits into from
Jan 28, 2022

Conversation

jkelleyrtp
Copy link
Member

This PR makes it so the use_route command subscribes the component to changes to the URL.

@jkelleyrtp jkelleyrtp requested a review from autarch January 28, 2022 17:01
Copy link
Contributor

@autarch autarch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question about naming.


router.subscribe_onchange(cx.scope_id());

UseRouteInner {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think calling this UseRouteInner is confusing when it's not contained in a UseRoute. Maybe the existing UseRoute needs to be renamed to Inner and this one should be UseRoute?

Copy link
Member Author

@jkelleyrtp jkelleyrtp Jan 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmmm maybe something like UseRouteListener since its only job is to be dropped when the component is unmounted?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense.

@jkelleyrtp jkelleyrtp requested a review from autarch January 28, 2022 17:15
@jkelleyrtp jkelleyrtp merged commit 0d8e9f5 into master Jan 28, 2022
@jkelleyrtp jkelleyrtp deleted the jk/use_route_subscribes branch February 4, 2022 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants