@MgSam
Although I agree that having SPServices calls return a Deferred .promise() would be helpful, I don't agree that it should be the default behavior (should @sympmarc decide to implement it)... Specially if SPServices() currently returns a jquery object which allows for chaining (I don't remember if it does).
But... You can also use jQuery's Deferred() object along with SPServices calls to accomplish what you are asking for here... Yes, it is a "little" more coding.. but not much more... Just wrap SPServices calls in a deferred object and return the .promise()... Here is an example I have used often in the past:
$.when( $.Deferred(function(dfd){ $().SPServices({ operation: "GetListItems", async: true, listName: myListId, completefunc: function(xData, status){ // do your call back stuff here // resolve the deferred object dfd.resolve(); } }) }).promise(), $.Deferred(function(dfd){ $().SPServices({ operation: "UpdateListItems", async: true, listName: myListId, completefunc: function(xData, status){ // do your call back stuff here // resolve the deferred object dfd.resolve(); } }) }).promise(), $.Deferred(function(dfd){ $().SPServices({ operation: "GetListItems", async: true, listName: myListId, completefunc: function(xData, status){ // do your call back stuff here // resolve the deferred object dfd.resolve(); } }) }).promise(), $.Deferred(function(dfd){ $().SPServices({ operation: "GetListItems", async: true, listName: myListId, completefunc: function(xData, status){ // do your call back stuff here // resolve the deferred object dfd.resolve(); } }) }).promise() ) .then(function(){ // do something here after all calls above are done. });
The Deferred functionality in jQuery is quite advanced and I don't claim to know all the ways to use it... I believe that in resolving the object you can also set pieces of information for the down stream queued operations...Use this approach allot when controlling UX after what I call "compound" updates to multiple lists.
Hope this example helps others...
Paul