Skip to content

Updating intersect helper to work with ManyArrays#341

Open
gmurphey wants to merge 1 commit into
DockYard:masterfrom
gmurphey:intersect-many-array
Open

Updating intersect helper to work with ManyArrays#341
gmurphey wants to merge 1 commit into
DockYard:masterfrom
gmurphey:intersect-many-array

Conversation

@gmurphey

Copy link
Copy Markdown
Contributor

Changes proposed in this pull request

Currently the intersect helper returns an empty array when using an Ember Data has many relationship. This PR updates the way intersections are tested and accesses the members of a given array in a consistent and predictable way.

Thanks for the great addon!

@gmurphey gmurphey force-pushed the intersect-many-array branch from c6e56e7 to ce6f0a3 Compare November 20, 2019 18:07

@snewcomer snewcomer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💯

let array = emberArray(arrays[i]);
for (let j = 0; j < array.length; j++) {
if (array[j] === candidate) {
if (array.objectAt(j) === candidate) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One question @gmurphey before merging - what makes this code as is on master not able to work with Ember arrays?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ping!

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