Skip to content

Instantly share code, notes, and snippets.

@Valid
Created October 20, 2010 22:43
Show Gist options
  • Select an option

  • Save Valid/637504 to your computer and use it in GitHub Desktop.

Select an option

Save Valid/637504 to your computer and use it in GitHub Desktop.
getData = function(field, callback) {
console.log('this would get the data from ' + field + ' then continue');
db.getFromField(field, function(error, response) {
if(!error) {
data = response
callback(data);
callback('some data');
}
}
runner = function() {
// get data from field, 'username'
getData(username, function(data, callback) {
console.log('now you have ' + data)
})
}
runner()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment