Promisifying API callbacks - How to properly resolve or reject
问题 I've read similar posts, but none quite hit on the head how to do this correctly. I understand Promises and how they are typically created with success and failure listeners waiting to be triggered to either resolve or reject. What I don't understand is when I'm calling an API method that takes a success and failure callback as parameters - how do I determine which callback is being triggered so I can then have it resolved or rejected? For example with this Web API and considering the