andrewducker: (Default)
andrewducker ([personal profile] andrewducker) wrote2013-04-21 09:34 pm

Nice weekend

I've had a nice relaxing weekend, with the visiting of friends, a bit of tidying, a meal out with Julie, and then an evening learning how Deferred works in jQuery, and being introduced to the Ripple Currency Exchange, which is an absolutely fascinating idea that I suspect would have all sorts of interesting side-effects.
emceeaich: A close-up of a pair of cats-eye glasses (Default)

[personal profile] emceeaich 2013-04-22 08:11 am (UTC)(link)
Deferred made my code so much more readable, and the lovely thing is that Backbone.Model.fetch/save/delete/etc and Backbone.Collection.fetch/etc all return JQuery deferred objects.
emceeaich: A close-up of a pair of cats-eye glasses (Default)

[personal profile] emceeaich 2013-04-23 01:32 am (UTC)(link)
So in the case of Backbone.Model and Collection, any work I'm going to do when the deferred returns would be in the context of that object (like raising events on on the object depending on the return from a sync) so if I keep my context as the object where I'm creating the deferred in, then the object will maintain the portion of state I'm concerned with.