yeah I'd rather we do .once('add remove reset') or similar. Triggering on
anything is a little silly IMO.


On Fri, May 16, 2014 at 5:13 PM, Yousef Cisco <notifications@github.com>wrote:

> In backbone.stickit.js:
>
> > @@ -593,7 +593,14 @@
> >        }
> >
> >        // Support Backbone.Collection and deserialize.
> > -      if (optList instanceof Backbone.Collection) optList = optList.toJSON();
> > +      if (optList instanceof Backbone.Collection) {
> > +        // Listen to the collection for all events and trigger an update of the select options.
> > +        optList.once('all', function() {
>
> Once because if we used on then we would get a huge number of listeners
> set against the collection very quickly since the old listener is not
> deleted after this function is called again and we don't want to manually
> manage listeners on the collection since that's up to the dev.
> I used all instead of change so we can detect add and remove events
> without having to set multiple event listener.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/NYTimes/backbone.stickit/pull/237/files#r12760037>
> .
>