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

Add observeAttributes parameter to waitForChildAdd() #145

Merged
merged 1 commit into from
Mar 30, 2024

Conversation

throwaway96
Copy link
Member

You must now specify whether waitForChildAdd() should check the predicate on attribute changes. Its only caller did not depend on this behavior, so the callback and predicate were running hundreds of times unnecessarily.

A new parameter, observeAttributes, has been added (before abortSignal). When it is true, you will get the old behavior. When it is false, the predicate will not be called on attribute changes—meaning you will only see each node once as it is initially added.

I don't expect this to have much effect right now, as waitForChildAdd() is only used once. (It was also used in a now-canceled change.) However, this function is useful enough that it it is likely to be used in the future, including in more performance-sensitive areas.

@throwaway96 throwaway96 added this to the v0.3.3 milestone Mar 29, 2024
@throwaway96 throwaway96 mentioned this pull request Mar 29, 2024
You must now specify whether waitForChildAdd() should check the
predicate on attribute changes. None of its callers depended on this
behavior, so the callback and predicate were running hundreds of times
unnecessarily.

A new parameter, observeAttributes, has been added before abortSignal.
When it is true, you will get the old behavior. When it is false,
the predicate will not be called on attribute changes.
@throwaway96 throwaway96 merged commit c8dcbd4 into webosbrew:main Mar 30, 2024
1 check passed
throwaway96 added a commit that referenced this pull request Mar 30, 2024
fire332 pushed a commit to fire332/youtube-webos that referenced this pull request Mar 31, 2024
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.

None yet

1 participant