-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Return the add_listener method for VTag #2298
Comments
@bakape Do you remember why it got removed? |
@voidpumpkin The listener vector was converted into a boxed array to reduce construction overhead. This is a microptimasation that should not break almost all use cases. I also have a PR in the works, that enables allocating said arrays on the stack (among other things), so I don't see this changing. If dynamic size listener arrays are needed, best build vectors, convert them to boxed arrays and then pass that to the VTag. |
@bakape I think your explanation ended up being a little bit too complex for me. By boxed array, I presume, you mean its a slice now (i see the same in the code). And by that it means you have to set all setters at once as its size is not dynamic. |
@XX Could you explain more about what |
A boxed array is an owning reference to a heap-allocated static size array. That reference is a
You would need it for writing libraries (or other abstractions), that work on individual VDOM types - lower level API than the
Sure, I'll take a look. |
The
add_listener
function is needed for my project https://github.com/noogen-projects/yew-mdc-widgets, but it was removed in the #1542 PR: https://github.com/yewstack/yew/pull/1542/files?authenticity_token=Tuuykd78jnZ%2BAdLNBHI59D2wWoJnpGuCUvZPLJvjNMkmLvrDf%2FM0Ap0XHwA0TZAGVPz2sH8w8OU6s1696gisMA%3D%3D&file-filters%5B%5D=.rs#diff-ca7fccc825bdf79bdab83f034636dee4d6727ba13ee5578dc8eb784b1d136478L503But why? Can I return this method or is it impossible?
The text was updated successfully, but these errors were encountered: