daily pastebin goal
71%
SHARE
TWEET

Untitled

a guest Mar 8th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function simonSays(speech: string, callback: Function) {
  2.   callback(undefined, speech);
  3. }
  4.  
  5. function promisedSimonSays(speech: string): Promise<string> {
  6.   return new Promise((resolve, reject) => {
  7.     simonSays(speech, (err: any, result: any) => {
  8.       if (err) {
  9.         reject(err);
  10.       } else {
  11.         resolve(result);
  12.       }
  13.     });
  14.   });
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top