Description

Make a new promise from the parameter.

Signature


calli.resolve(thenable)

calli.resolve(obj)
Parameter Description
thenable A thenable is promise-like in as far as it has a "then" method. Make a new promise from the thenable.
obj Make a promise that fulfils to obj. in this situation.

Example


story.chapterUrls.reduce(function(sequence, chapterUrl) {
  // Add these actions to the end of the sequence
  return sequence.then(function(){
    return calli.getJSON(chapterUrl);
  }).then(function(chapter){
    addHtmlToPage(chapter.html);
  });
}, calli.resolve()); // Start off with a promise that always resolves