Skip to content

Improving JavaScript API #73

Closed
Closed

Description

@tbranyen

Once we settle down the dust from the new API changes from @nkallen's work, I'd like to revisit our JS API. Was talking to @cowboy today and he brought up promises and I totally agree that we should support them in some fashion.

Our convenience API may be best suited for this completely optional feature.

Thoughts?

Activity

  1. nkallen commented on Jun 25, 2013

    @nkallen
    Contributor

    I've played with Q which is ok. It has a nice feature that allows you, with the same function, to return either a promise or act like a node CPS. So it's worth considering. My experience with it, though, is that it saved only a tiny bit of boilerplate code (constantly checking if (error) return callback(wrap(error))) at the cost of another API to learn. It often doesn't eliminate callback nesting since you need intermediate values in the innermost callback.

  2. tbranyen commented on Jun 25, 2013

    @tbranyen
    MemberAuthor

    It's not about eliminating callbacks it's about providing an alternative control flow, which to some doing parallel or frequent async operations can mean more succinct code.

    It was also proposed, as a possibility, to make a nodegit-promisify library that wraps the nodegit module and then exposes a Promise-based API.

  3. faceleg commented on Jun 25, 2013

    @faceleg
    Collaborator

    +1 for nodegit-promisify

  4. tbranyen commented on Jun 26, 2013

    @tbranyen
    MemberAuthor

    Another cool improvement that could be made to the JavaScript API is implementing Streams.

  5. tbranyen commented on Mar 23, 2014

    @tbranyen
    MemberAuthor

    Closing in favor of keeping nodegit raw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions