Skip to content

setKeys() and setItems() do not support ArrayLike Iterables because they use [].concat() for a shallow copy #20

@SamuelTrew

Description

@SamuelTrew

If I were to call setItems with something like a mobx ObservableArray, to JS it is an iterable object.
So when concat is called at the beginning of the setItems function, it doesn't properly concat, due to not being an actual array. (turns into an array that contains a mobx array that contains an object).

I know this is not exactly the libraries fault, but it would be nice to support ArrayLike Iterables.

I suggest that the spread operator is used instead to copy:

[...items] as opposed to [].concat(items)

Thanks!

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions