4 ms·
this probably isn't a bug, but just curious why the 2nd xhr parameter was removed from the collection parse handler? I was using it to check the raw response a
by jakejake 14y ago
this probably isn't a bug, but just curious why the 2nd xhr parameter was removed from the collection parse handler?
I was using it to check the raw response and determine if the collection had actually changed & then supress unnecessary view renders. I worked around it by just stringifying the response instead, but it was a breaking change for some of my code.
Otherwise I've been playing around and it looks cool so far.
- jashkenas 14y agoBecause with the change that was made to parse more consistently ... i.e. whenever a "parse" function is defined, not just at the Ajax border, so that now if you have both `collection.parse` and `model.parse` defined, you'll get both -- parsing was no longer happening when an XHR object was necessarily available. I'm also of the mind that it ought to be a function that works purely in terms of your data. For your particular use case (call collection.fetch(), and don't re-render if nothing has changed) -- give the new collection.fetch({update: true}) a try. That should give you zero events if all of the model contents are identical to what's already in the collection.
- jakejake 14y agocool thanks for the response, that makes sense. I have my code working again but I'll check out the new fetch param as well.