batmanjs/batman — pull request #861 by matthelm (2013-10-18 19:27:23+00:00)
Title: batchAccessorChanges > recalculate accessors only once

I've added `batchAccessorChanges` to `Batman.Object` to allow many changes to an objects properties without an accessor being recalculated until the end.

*use case*
I have an observe on `fullName` and only want to perform the callback once even after changing both `firstName` and `lastName`. Currently if you change `firstName` then change `lastName` it'll recalculate, fire and call twice. I want the option to have this happen once.

*solution*
Add a flag to `Batman.Object` to break out of accessor recalculation. The properties (`firstName` and `lastName`) will still fire their events, but `fullName` won't recalculate. Once the `wrappedFunction` has completed it'll refresh the accessor. We looked at an alternate solution where you still recalculate the accessor, but don't fire the accessor's change event; however, that seemed less optimal.

@nickjs @SoapyIllusions @pushrax

/cc @boourns @mkobetic