Coder Social home page Coder Social logo

Node-style callbacks? about intercom-node HOT 10 CLOSED

intercom avatar intercom commented on July 24, 2024
Node-style callbacks?

from intercom-node.

Comments (10)

bobjflong avatar bobjflong commented on July 24, 2024

Hi @pcothenet

Thanks for getting in touch. We're still very much developing this lib, and we're hopeful we can get it to something everyone really loves using.

Re. your first point, would you mind checking out this diff? #18

from intercom-node.

pcothenet avatar pcothenet commented on July 24, 2024

That looks way better yes! (I don't think the doc is up-to-date though).

No worries, I'm actually super happy that you guys are building an official library. Happy to help!

from intercom-node.

bobjflong avatar bobjflong commented on July 24, 2024

@pcothenet docs updated with a note about calllbacks https://www.npmjs.com/package/intercom-client

from intercom-node.

tejasmanohar avatar tejasmanohar commented on July 24, 2024

👍 for what @pcothenet said. If you're going to expose callback-style functions, it should really follow node-style callbacks. The great part of this is users of the API can even integrate things like Bluebird's promisify() with their code to wrap your library if the convention is followed :D

from intercom-node.

bobjflong avatar bobjflong commented on July 24, 2024

@tejasmanohar when you say "node-style" are you referring to promises too? I may split out promises into another issue and close this to reduce confusion if so.

from intercom-node.

tejasmanohar avatar tejasmanohar commented on July 24, 2024

@bobjflong Nope, not at all. function(err, result) = node-style callbacks. My comment on Bluebird was related to Bluebird's promisify method which only works for node-style callbacks. Anyhow, node-style is the way to go due to convention :) - I have a few points of feedback on this repo and will send PRs soon.

from intercom-node.

bobjflong avatar bobjflong commented on July 24, 2024

@tejasmanohar but the callbacks currently support the form function(err, result) - see #18

from intercom-node.

tejasmanohar avatar tejasmanohar commented on July 24, 2024

Ah ok perfect, sorry, I was looking at the wrong thing. Thanks for clarifying, @bobjflong! I would recommend opening another issue for promises as well then as this is a bit misleading in title.

from intercom-node.

bobjflong avatar bobjflong commented on July 24, 2024

Done here: #45 I will likely add this today

from intercom-node.

tejasmanohar avatar tejasmanohar commented on July 24, 2024

Thanks, @bobjflong! Till then, users should be able to promisify this using a module like Bluebird or an independent one on NPM to get the same end result :)

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.