can.List.prototype.then
list.then( doneFilter, [failFilter] )
Add handlers to be called when the list is resolved or rejected. This works very similar to jQuery's done.
Parameters
-
doneFilter
{function(list)}
A function that is called when the list's promise is resolved. It will be called with the list instance. If the function returns a value it will be used to resolve the promise returned by
.then
. -
failFilter
{function(reason)}
OptionalA function that is called when the list's promise is rejected. It will be called with the reason. If the function returns a value it will be used to reject the promise returned by
.then
.
Returns
{Promise}
A new promise that will be resolved and rejected
based upon what doneFilter
and fileFilter
return.
Use