Skip to content

Instantly share code, notes, and snippets.

@pionize
Created April 17, 2017 10:04
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save pionize/270a1ef534cf5accce69e19c9e1efa41 to your computer and use it in GitHub Desktop.
Promise Pattern
db.allDocs(...).then(function (resultOfAllDocs) {
return localdb.put(...);
}).then(function (resultOfPut) {
return localdb.get(...);
}).then(function (resultOfGet) {
return localdb.put(...);
}).catch(function (err) {
console.log(err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment