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

Remove clones from events passing #17

Open
filipdutescu opened this issue Apr 9, 2023 · 0 comments
Open

Remove clones from events passing #17

filipdutescu opened this issue Apr 9, 2023 · 0 comments
Assignees
Labels
feature New feature or request
Milestone

Comments

@filipdutescu
Copy link
Owner

Description

All events are currently sent to html! macro by cloning them. This is very inefficient and bad code.

Proposal

Swap all event callbacks from Option<yew::Callback<T>> to yew::Callback<T>, as the default (using #[prop_or_default]) does basically the same anyways (not setting an event on the element). This further allows passing by reference, ie onclick={&props.onclick}.

Other relevant information

No response

@filipdutescu filipdutescu added the feature New feature or request label Apr 9, 2023
@filipdutescu filipdutescu added this to the 1.0 milestone Apr 9, 2023
@filipdutescu filipdutescu self-assigned this Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant