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

Connect the onchange listener for the Router #158

Merged
merged 1 commit into from
Jan 27, 2022
Merged

Conversation

jkelleyrtp
Copy link
Member

@jkelleyrtp jkelleyrtp commented Jan 25, 2022

This PR wires up onchange listeners for the Router (at the top level) so you can easily connect things like modifying the title/head.

Also ccing @autarch since you spent a while on the router

@jkelleyrtp jkelleyrtp requested a review from autarch January 25, 2022 20:47
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.

This looks reasonable to me, though I'm not sure I understand every bit of it.

@jkelleyrtp
Copy link
Member Author

This looks reasonable to me, though I'm not sure I understand every bit of it.

We're just sending updates into the update queue and regenerating the root. Dioxus knows to memoize children via their pointers, so the operation is still cheap.

@jkelleyrtp jkelleyrtp merged commit 08988e1 into master Jan 27, 2022
@jkelleyrtp jkelleyrtp deleted the jk/router-onchange branch January 28, 2022 03:19
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