ThomasBurleson
10/22/2013 - 12:00 PM

Sample of how to easily chain promises.

Sample of how to easily chain promises.

function makePromiseToParty () 
{
    // Note all the `fn` [used in then( fn )] return a Promise instance
    
    return familyPlanner.inviteGuests()
                     .then( prepareSundayRoastDinner )
                     .then( serveDinner             )
                     .then( eatDinner                )
                     .then( cleanDishes              );
        
};