Advertisement
xXCalleManXx

Untitled

Jan 20th, 2022 (edited)
758
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function hasSong(author, callback) {
  2.   // Represent a async data fetch
  3.   setTimeout(function() {
  4.     callback(author === 'BestAuthor');
  5.   }, 100)
  6. }
  7.  
  8. function hasSongMessage(hasSong, callback) {
  9.   setTimeout(function() {
  10.   // Represent getting async message based on parameter
  11.   if (hasSong) {
  12.     callback('Has song');
  13.   } else {
  14.     callback('No song');
  15.   }
  16.   }, 100);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement