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

Rename {{contains}} helper to {{includes}} #379

Merged

Conversation

jelhan
Copy link
Contributor

@jelhan jelhan commented Aug 25, 2020

This renamed {{contains}} helper to {{includes}} as discussed in #365. A deprecation warning is added for the old name.

Additional I have refactored to code:

  • Remove code only needed to support Ember versions, which fall back to EmberArray.contains() if EmberArray.includes() is not available. EmberArray.contains() has been removed in 2.x. EmberArray.includes() is available in all supported version.
  • Avoid converting the array passed in multiple times to EmberArray if an array of needles is provided.
  • Use Array.every() (or EmberArray.every()) instead of Array.reduce() to improve readability and performance.
  • Use same code path for single needle and array of needles to reduce complexity. This may have a bad performance impact as it requires creating an interim array if a single needle is passed. But the performance impact should be small enough to be acceptable.

Closes #365

Copy link
Contributor

@snewcomer snewcomer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR!!

@snewcomer snewcomer merged commit 8ef94db into DockYard:master Sep 2, 2020
erikap pushed a commit to mu-semtech/ember-data-table that referenced this pull request Oct 2, 2020
This is literally just replacing the 2 words by each other. Functionality wise nothing changes. It will remove the deprecation warning in console though.
Ref: DockYard/ember-composable-helpers#379
@Alonski
Copy link

Alonski commented Jan 30, 2021

@jelhan @snewcomer Not to be picky but the README wasn't updated with this change 😜

@bertdeblock
Copy link
Contributor

Created #397 for the docs part.

elwayman02 added a commit to elwayman02/ember-models-table that referenced this pull request Jan 8, 2022
* The only breaking change appears to be removing the already-deprecated `contains` helper, which was renamed to `includes` over a year ago: DockYard/ember-composable-helpers#379
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.

Rename contains helper to includes
4 participants