Ensure promise example works out of the box

Updated with feedback from @twokul & @stefanpenner
Further update to code example
Merge pull request #1255 from mfeckie/patch-2

Ensure promise example works out of the box