Skip to content

Instantly share code, notes, and snippets.

@kopylovvlad
Last active April 30, 2017 12:40
Show Gist options
  • Save kopylovvlad/3c2f47f0106769f6d162fe99e068ce12 to your computer and use it in GitHub Desktop.
Save kopylovvlad/3c2f47f0106769f6d162fe99e068ce12 to your computer and use it in GitHub Desktop.
_loadDataForUser = (url, callback) ->
setTimeout(callback, 2 * 1000)
loadDataForUsers = (userNames) ->
for i in userNames
_loadDataForUser "users/#{userNames[i]}", ()->
console.log('Fetching for ', i)
loadDataForUsers(['John', 'Eve', 'Oleg'])
# Fetching for Oleg
# Fetching for Oleg
# Fetching for Oleg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment