Created
June 25, 2014 15:38
-
-
Save nolanlawson/c5695b4f0886400b0a6f to your computer and use it in GitHub Desktop.
promisy db.get
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
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