can.List.prototype.done

  • function
 

list.done( doneCallback )

Add handlers to be called when the list is resolved. This works very similar to jQuery's done.

Parameters

  1. doneCallback {function(list)}

    A function that is called when the list's promise is resolved. It will be called with the list instance.

Returns

{Promise}

The list's promise.

Use

var data = new can.Deferred();
var list = new can.List(data);

list.done(function(l){
  l === list //-> true
});

data.resolved(["a","b"]);