opentok-node
opentok-node copied to clipboard
Introduce Promise-based APIs
Is there any plans to implement this?
Yes there are, but not in the very near future.
Another strong vote for this from me.
Hey there! I'm the new node advocate here at Vonage (OpenTok). This is definitely something I'm going to address soon.
Until this feature will become live an option is to use this module which can transform callbacks into Promises and vice versa https://www.npmjs.com/package/catering
I have been using Node's built-in promisify
function for Clowdr. You lose a bit of type information in the promisified version of the function, but it works!
I do something similar as well - this is our Vonage SDK - also with no promises support.
get allApplications() {
return new Promise((res, rej) => {
this.vonage.applications.get({}, (error, response) => {
if (error) {
rej(error);
}
else {
res(response);
}
}, true);
})
}