You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling collection.reset() without arguments causes a wrong behaviour due to line 588 of query-engine.js. (QueryCollection.prototype.add). It looks the problem is the condition that forces the creation of an array when models argument is not one (:[models]). It creates an array even in the case the models argument of add method is undefined. This causes the array to have 1 phantom element ({}).
Fortunately there is an easy workaround, to call reset method with an an empty array (collection.reset([])). This way the condition that gets evaluated is ?models.slice() and that returns an empty array which is the expected behaviour.
Are you accepting pull requests? I see many issues open.
The text was updated successfully, but these errors were encountered:
Calling
collection.reset()
without arguments causes a wrong behaviour due to line 588 ofquery-engine.js.
(QueryCollection.prototype.add
). It looks the problem is the condition that forces the creation of an array whenmodels
argument is not one (:[models]
). It creates an array even in the case themodels
argument ofadd
method isundefined
. This causes the array to have 1 phantom element ({}
).Fortunately there is an easy workaround, to call
reset
method with an an empty array (collection.reset([])
). This way the condition that gets evaluated is?models.slice()
and that returns an empty array which is the expected behaviour.Are you accepting pull requests? I see many issues open.
The text was updated successfully, but these errors were encountered: