canjs / can-connect

Model layer utilities for every JavaScript framework! Assemble real-time, high performance, restful data connections.
https://canjs.com/doc/can-connect.html
MIT License
29 stars 16 forks source link

constructor/store: add references to instances in list when adding reference to list #404

Closed bmomberger-bitovi closed 6 years ago

bmomberger-bitovi commented 6 years ago

This prevents duplicate constructor instances when instances aren't directly bound, but are members of a list which is bound.

We saw this happening in Equibit and it made post-processing after loading items not work well (since an instance may have two or more copies, and the wrong one got the post-processing).

This PR is against the legacy 1.x versions of can-connect (CanJS 3.0 legacy), but after review, may also benefit the latest master branch as well.