I use dynogels which is an framework to wrap AWS dynamoDB table, I use it to delete my item on the dynamoDB Table, the function they provide is callback functions.
https://github.com/clarkie/dynogels //document
// Destroy model using hash and range key
BlogPost.destroy('foo@example.com', 'Hello World!', function (err) {
console.log('post deleted')
});
But I would like to use promise instead of callback, then I am thinking can I put the Promise.resolve in the callback?
BlogPost.destroy('foo@example.com', 'Hello World!', Promise.resolve())
.then(()=>{
console.log('post deleted')
});
How do I make an callback to return promise? I can't think anyway can do it so far.