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

refactor: Remove internal uses of the .first() and .matchCondition() helpers #889

Merged
merged 1 commit into from
Feb 8, 2025

Conversation

absidue
Copy link
Collaborator

@absidue absidue commented Feb 7, 2025

As those ObservedArray helpers are just thin wrappers around [0] and .find() respectively. Using the original versions should be slightly faster and uses slightly less code, without losing any functionality.

It might be worth deprecating the .first(), .matchCondition() and .remove() helpers, because they all are just thin wrappers that don't provide any additional functionality than just interacting with the array yourself directly. Removing them straight away might break users code, hence the suggestion to deprecate them first.

@LuanRT
Copy link
Owner

LuanRT commented Feb 8, 2025

Those are just helper functions for a better dev exp really, so we won't be deprecating them (and sadly, I have some projects with thousands of lines that rely on these :p, it would be a pain to refactor that.)

I do agree that we shouldn't use them internally though.

@LuanRT LuanRT merged commit 0e86902 into LuanRT:main Feb 8, 2025
4 checks passed
@absidue absidue deleted the observed-helper-cleanup branch February 8, 2025 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants