Skip to content

Instantly share code, notes, and snippets.

@ajcrites
Created August 16, 2013 12:39
Show Gist options
  • Save ajcrites/6249540 to your computer and use it in GitHub Desktop.
Save ajcrites/6249540 to your computer and use it in GitHub Desktop.
Example of synchronous vs. asynchronous JS
// Old, bad, antiquated way
var value = db.synchronousRead("SELECT value");
emit(value);
// Good, asynchronous way
db.asynchronousRead("SELECT value").done(function (value) {
emit(value);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment