Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

use Array.isArray instead of ɵisListLikeIterable which is deprecated #35

Closed
wants to merge 1 commit into from

Conversation

ubaidazad
Copy link

This PR addresses bug #34 by fixing the issue ɵisListLikeIterable which is imported from @angular/core and is deprecated in latest versions.

@@ -86,7 +85,7 @@ export abstract class TemplatedItemsComponent implements DoCheck, OnDestroy, Aft
if (value instanceof ObservableArray) {
needDiffer = false;
}
if (needDiffer && !this._differ && isListLikeIterable(value)) {
if (needDiffer && !this._differ && Array.isArray(value)) {
Copy link

Choose a reason for hiding this comment

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

isListLikeIterable does a little more than just isArray(), do we need it here as well?

export function isListLikeIterable(obj: any): boolean {
  if (!isJsObject(obj)) return false;
  return Array.isArray(obj) ||
      (!(obj instanceof Map) &&  // JS Map are iterables but return entries as [k, v]
       Symbol.iterator in obj);  // JS Iterable have a Symbol.iterator prop
}

@farfromrefug
Copy link
Member

@ubaidazad thanks it should be fixed in this commit 68f4255

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants