-
Notifications
You must be signed in to change notification settings - Fork 32
Cleanup global event listeners #124
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
base: main
Are you sure you want to change the base?
Conversation
Preview available at https://dioxuslabs.github.io/components/pr-preview/pr-124/ |
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.
Great job, thank you for improvements🙏
} | ||
|
||
/// Run some cleanup code when the component is unmounted if the effect was run. | ||
fn use_effect_with_cleanup<F: FnMut() -> C + 'static, C: FnOnce() + 'static>(mut effect: F) { |
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.
Could you please add this to the framework or a utils crate?
This PR removes any global event listeners components use when the component is removed
Depends on DioxusLabs/dioxus#4655
Fixes #123