Skip to content

Instantly share code, notes, and snippets.

@doron2402
Created January 11, 2017 05:48
Show Gist options
  • Save doron2402/eb566ef66f3a963558343ee83a7a2cb4 to your computer and use it in GitHub Desktop.
Save doron2402/eb566ef66f3a963558343ee83a7a2cb4 to your computer and use it in GitHub Desktop.
Callback hell
function isUserAuthenticate(session, callback) {
openDatabase(function(db) {
getCollection(db, 'sessions', function(col) {
find(col, {'session': session},function(result) {
result.filter(function(error, user) {
callback(error, user);
})
})
})
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment