Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function hasSong(author, callback) {
- // Represent a async data fetch
- setTimeout(function() {
- callback(author === 'BestAuthor');
- }, 100)
- }
- function hasSongMessage(hasSong, callback) {
- setTimeout(function() {
- // Represent getting async message based on parameter
- if (hasSong) {
- callback('Has song');
- } else {
- callback('No song');
- }
- }, 100);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement