Coder Social home page Coder Social logo

Revise Promise support about intercom-node HOT 4 CLOSED

intercom avatar intercom commented on July 24, 2024
Revise Promise support

from intercom-node.

Comments (4)

bobjflong avatar bobjflong commented on July 24, 2024

I'm not opposed to falling back to promises if a callback is absent. Should be easy and doesn't break compatibility afaik. But - I'd point out that the "core" code that switches between callbacks and promises is quite small and localised (client.js) - so I'm not sure there's much benefit in redesigning it to use promises only + nodeify.

We'll definitely always support callbacks I think - if for no other reason than backwards compatibility.

from intercom-node.

tejasmanohar avatar tejasmanohar commented on July 24, 2024

@bobjflong Alright. I see what you're saying. I'll look more into that sometime next week and see if can be cleaned up some to use nodeify... and if so, send a PR.

from intercom-node.

Nathan219 avatar Nathan219 commented on July 24, 2024

When using the usePromises(), I get warnings when I get errors

Warning: a promise was rejected with a non-error: [object Object]
    at resolver (/Users/nathan/runnable/api/node_modules/intercom-client/dist/client.js:115:19)
    at callback (/Users/nathan/runnable/api/node_modules/intercom-client/dist/client.js:175:11)

We're using node 10.26, with bluebird. If I promisifyAll on the models, I get acceptable errors. But when using usePromises(), I can't even tell what the error is at all

from intercom-node.

bobjflong avatar bobjflong commented on July 24, 2024

@Nathan219 thanks for raising this. Would you mind checking out this branch? #64

I plan on removing usePromises and falling back to promises if no callback is provided.

from intercom-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.