clonn / slack-node-sdk

slack.com, slack, node sdk
MIT License
167 stars 32 forks source link

Does this tool support promises #42

Closed hisabimbola closed 7 years ago

hisabimbola commented 7 years ago

Hello,

I am planning to use this module and I saw from the readme that it supports promises, but when I do this I get an error that .then is not a function

slack.api('users.list').then((result) => {
})

Any help would be highly appreciated.

Danke.

kevinburkeshyp commented 7 years ago

I don't think so... sorry...

On Sat, Nov 26, 2016 at 21:17 Abimbola Idowu notifications@github.com wrote:

Hello,

I am planning to use this module and I saw from the readme that it supports promises, but when I do this I get an error that .then is not a function

slack.api('users.list').then((result) => { })

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/clonn/slack-node-sdk/issues/42, or mute the thread https://github.com/notifications/unsubscribe-auth/AKPN0ccdGVS_61nezupRv3I0gU8eEqYKks5rCRJggaJpZM4K9ETZ .

hisabimbola commented 7 years ago

Any plans to add it @kevinburkeshyp I can submit a PR is it's a desired feature?

Thebigbignooby commented 7 years ago

+1 README states :

0.1.6

support ES6, promise function.

however it throws a TypeError callback is not a function when I try to use it as a promise

kevinburke commented 7 years ago

Hi folks, really sorry about this. I think I am going to leave the library as is for the moment. I'd encourage you to wrap it via Promise.promisify() in your own codebase, or just check the source code into your own codebase, and modify it to fit your needs.

I'll update the README so it doesn't mention promises anymore.