-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Hey everyone,
I recently ran into a case where I needed to use a function similar to AmpersandCollectionView._getViewByModel
. It seems to me that the need to do this would be frequent enough to warrant creating a public (non-underscore prefixed) method to allow fetching the view representing a given model.
What do you think about this?
In addition, it seems like the complexity of this method could be cut drastically by using a map (plain JS object) instead of an array to store in AmpersandCollectionView.views
, with the key as the AmpersandState.cid
and the value as the actual created view. Since the cid
should be unique and never-changing, this should work great; and it would remove the need for a loop in the _getViewByModel
method.
Again, what do the devs think about this.
The one concern I have is breaking backwards-compatibility with people using the views
property. Is that a real concern?