Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@panglesd
Copy link
Contributor

This adds bindings to the ResizeObserver API.
For now, only target can be extracted from entries, but that is a first step.

@dbuenzli
Copy link
Owner

I have a bunch of ad-hoc bindings to these in various projects (e.g. here and there) so I want to have relook at them first, but that won't happen immediately. Also if we add support for it, it should be mentioned here.

@dbuenzli
Copy link
Owner

Now that you spelled it out, I realize I actually never bound ResizeObserver but MutationObserver and IntersectionObserver.

@dbuenzli
Copy link
Owner

dbuenzli commented Jul 21, 2025

Sorry @panglesd but I'm not going to merge that for the next release.

I think a common strategy should be adopted for all these Observer APIs. But since they are performance sensitive, I'm not sure the API you gave here is the most appropriate (that is converting the array of entries to a list).

@dbuenzli
Copy link
Owner

I don't have the time to think about now but just so that I don't forget. I think it's likely better to pass in a fold function (instead of converting the array to a list). This pattern is already used in a few other places for dealing with the iterator protocol and most recently in the Regexp.Result module.

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