I have a plugin I'm writing for a framework that uses Promises throughout. The plugin is expected to return a Promise to process the event, and anything the plugin does during processing is chained before returning the next event. I think...
Anyway - I am also using an older library that is completely callback based - and the callback doesn't follow the standard convention of having callback(err,resp) as the last parameter.
How do I turn this:
var call = libary.Api(_this.config.url, function(response){return new Promise() {Do my actions with the response..}}, _this.config.api_key);
return BbPromise.try(call).then(evt);
Into a Promise that depends on the callback being processed?