Archive for the 'Deferred Objects' Category

Deferred Object… Caching

Saturday, July 5th, 2014

A lot of times you have to get data from a server through and AJAX call.  The problem is that you don’t want to make the call if you’ve previously requested the data.

So instead of requiring the data be requested over and over again you can “cache” the data to be reused later.

Deferred objects can be used for this.

Deferred Object: state()

Friday, July 4th, 2014

The deferred object is useful for several things.  I think it’s most commonly used as follows.

1. A function calls another function the returns a deferred or a promise.

2) The function assigns functions to the completion events (success, failure, completion…)

So in this scenario the state is implied based on function that was called.

This is why I don’t feel real comfortable with the state() method.

I think on way to use the state object is by using the deferred object for caching.

More on using deferred objects for caching tomorrow.


Deferred Object Comfort Grid

Wednesday, July 2nd, 2014

I feel pretty good about deferred objects.  It’s time to start focusing in on the fine details.  I think the first step it to figure out what I need and in order to do that I need to find the parts that I don’t understand… I need a better view:

deferred.always(): comfort level = 9
deferred.done(): comfort level = 9 comfort level = 9
deferred.notify(): comfort level = 5
deferred.notifyWidth(): comfort level = 2
deferred.progress(): comfort level = 4
deferred.promise(): comfort level = 9
deferred.reject(): comfort level = 9
deferred.rejectWith(): comfort level = 3
deferred.resolve(): comfort level = 9
deferred.resolveWith(): comfort level = 3
deferred.state(): comfort level = 1
deferred.then(): comfort level = 6
jQuery.Deferred(): comfort level = 9
jQuery.when(): comfort level = 6

Deferred Objects… Study Round Up

Tuesday, July 1st, 2014

I have been trying to wrap my mind around jQuery deferred objects.  I think I have come a long way.  After spending a few weeks studying all of the deferred object methods I have a better understanding of how it all works.

I would say that I have a mastery of the deferred objects score of 6 out of 10.
I would say that I have an elite level of deferred objects score of 4 out of 10.
I would say that I have an expert level of deferred objects score of 8 of 10.

I have lost a little ground on the elite level because I haven’t coded with deferred objects for a while.  Time to come up with another project.