This example shows you how to move asynchronous calls into a promise structure. It should be pretty self explanatory