Created
January 11, 2017 05:48
-
-
Save doron2402/eb566ef66f3a963558343ee83a7a2cb4 to your computer and use it in GitHub Desktop.
Callback hell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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