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
Just noticed that index.get(123) actually behaves this way. So that's cool that it's possible to retrieve the instance, but I'm wondering if this makes behavior inconsistent with valueOf()?
Also, would it be possible/desirable for the below to be equivalent?
// or index.property(123).put(newProps),// depending on how you feel about aboveindex.get(123).put(newProps)index.set(123,newProps)
I am not sure how that would be possible if property is really going to return a variable that represents a given id at any point in time, for example:
const collection = new Collection([])
const index = collection.keyBy(model => model.get('Id'))
const slot123 = index.property(123)
const kerry = new Foo({ Name: 'Kerry', Id: 123 })
collection.push(kerry)
slot123.valueOf() -> value of kerry
But, it is not possible for slot123 === kerry before the kerry instance even exists, as far as I can tell.
Is it possible/desirable for maps generated by keyBy to return original variable instances?
The text was updated successfully, but these errors were encountered: