Skip to content

Instantly share code, notes, and snippets.

@nolanlawson
Created June 25, 2014 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nolanlawson/c5695b4f0886400b0a6f to your computer and use it in GitHub Desktop.
Save nolanlawson/c5695b4f0886400b0a6f to your computer and use it in GitHub Desktop.
promisy db.get
var getID = function (result) {
return result.id;
};
var db = new PouchDB('test');
return db.post({things: [1, 2, 3]})
.then(getID)
.then(function (id) {
return db.get(id);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment