Is it possible/desirable for maps generated by keyBy to return original variable instances?
class Foo extends Variable<{ Name: string, Id: number }> {}
const Collection = VArray.of(Foo)
const collection = new Collection([{
Name: 'Kerry',
Id: 123
}])
const index = collection.keyBy(model => model.get('Id'))
// fails
assert.strictEqual(index.property(123), collection.property(0))
// fails
assert(index.property(123) instanceof Foo)
let newProps = {
Name: 'Jerry',
Id: 123,
}
index.set(123, newProps)
// fails
assert.strictEqual(collection.get(0), newProps)
Is it possible/desirable for maps generated by keyBy to return original variable instances?