Add Enumerable.contains to deprecation guide #2600
Conversation
##### until: 3.0.0 | ||
##### id: ember-runtime.enumerable-contains | ||
|
||
The `Enumerable.contains` and `Array.contains` methods were deprecated in favor of `Enumerable.includes` and `Array.includes` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we represent theses as Enumerable#contains
? I tend to treat Enumerable.contains
as a method that is literally on that thing (class usually), and #contains
as a method that exists on an instance of that thing (object, mixin applied to object).
I think this should also mention the behavior change of |
|
||
Note that the second `startAt` parameter is only available for `Ember.Array` because `Ember.Enumerable` does not rely on index-ordered access. | ||
|
||
`Enumerable#without` and `MutableEnumerable#addObject` use now internally `includes` instead of `contains`. This leads to some changes: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"some minor breaking changes" perhaps
@bmeurant this is 100% gtg with a small patch and a rebase. Sorry for the trouble, but you can land that I'd I will merge? :-D |
@mixonic sorry for the delay. I made the change and rebased. Should be ok now. |
👏 thank you @bmeurant! :-D |
arr.includes('b'); // true | ||
arr.includes('d'); // false | ||
arr.includes(NaN); // true | ||
arr.contains(null); // true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line and the one below should be includes
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooooooops ! Yes it should be includes
, I missed it, sorry. I can update but this is already merged 😩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mixonic let me know if you want me to make a new PR to fix this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@locks 👍 thx. You're welcome
Deprecation guide update related to emberjs/ember.js#13553
rendered