These are chat archives for canjs/canjs

6th
May 2015
dylanrtt
@dylanrtt
May 06 2015 18:29
I am seeing strange side effects caused by using can/map/delegate with sorting. http://jsbin.com/jufumegeli/1/edit?html,js,output
dylanrtt
@dylanrtt
May 06 2015 18:37
the issue in my app is that when I empty() a particular element, an infinite sorting loop happens, but only when I have used delegate() on the list. pretty bizarre so I am trying to narrow it down so I can upgrade to 2.2.1+
Justin Meyer
@justinbmeyer
May 06 2015 18:42
delegate?
$().delegate?
or the can/map/delegate plugin?
dylanrtt
@dylanrtt
May 06 2015 18:43
can/map/delegate
Justin Meyer
@justinbmeyer
May 06 2015 18:43
oh
nm
could you do this w/o listening to delegate?
delegate will not be around (or changed a lot) in 3.0
however, listening to "change"
and manually looking at the attr that changed
can do pretty much the same thing
also, I uncommented, but it doesn't magically sort
how do you make that happen?
dylanrtt
@dylanrtt
May 06 2015 18:46
I just run it again and it does it
I'll try using the change handler and see if that works. I am basically trying to listen to model.list.*.foo
dylanrtt
@dylanrtt
May 06 2015 19:24
okay so ignore the jsbin I guess. using .bind() instead of delegate has the same effect
it also has the same effect of causing an infinite loop in my app which doesn't make any sense because simply binding an empty change handler shouldn't cause that...