opentok-node icon indicating copy to clipboard operation
opentok-node copied to clipboard

Introduce Promise-based APIs

Open aoberoi opened this issue 8 years ago • 7 comments

aoberoi avatar Jul 30 '16 21:07 aoberoi

Is there any plans to implement this?

francescov1 avatar Apr 20 '20 15:04 francescov1

Yes there are, but not in the very near future.

AlexLakatos avatar Apr 20 '20 16:04 AlexLakatos

Another strong vote for this from me.

rossng avatar Nov 29 '20 00:11 rossng

Hey there! I'm the new node advocate here at Vonage (OpenTok). This is definitely something I'm going to address soon.

kellyjandrews avatar Nov 30 '20 15:11 kellyjandrews

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

RoeelCohen avatar Feb 09 '21 21:02 RoeelCohen

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!

rossng avatar Feb 09 '21 23:02 rossng

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);
        })
    }

kellyjandrews avatar Feb 10 '21 16:02 kellyjandrews