Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to more standardish/expected callback(error, data) pattern #23

Closed
bryanburgers opened this issue May 10, 2014 · 7 comments
Closed
Labels

Comments

@bryanburgers
Copy link

It would be nice if the library used the standard callback pattern.

twit.get('/statuses/show.js', { id: id }, function(err, data) {
    if (err) {
        // ...
    }
    // do something with data
});
@sedge
Copy link

sedge commented May 16, 2014

Please please please!

I was pulling my hair out trying to figure out why my callback logic wasn't executing, only to find out it only executes when there's an error.

@desmondmorris This wouldn't be hard to implement. Should I file a P/R?

@desmondmorris
Copy link
Owner

👍 Its def time for this. @sedge go for it! We should probably track these changes against a new branch, 1.x. We can work towards a better callback pattern, test coverage and code standards.

@sedge
Copy link

sedge commented May 16, 2014

Will do. I was wrong about when the callback logic fires - user error 😦

sedge added a commit to sedge/node-twitter that referenced this issue Aug 23, 2014
Node standard is callback(err, data), and this patch updates the code to reflect this.
@fuchse
Copy link

fuchse commented Oct 2, 2014

👍

1 similar comment
@despairblue
Copy link

👍

@desmondmorris
Copy link
Owner

👍 I am starting to flesh a roadmap for a general cleanup of this library. This will be top of th is list https://github.com/desmondmorris/node-twitter/wiki/1.x-Roadmap

@desmondmorris
Copy link
Owner

@bryanburgers @sedge @fuchse @despairblue - A new callback pattern has been added to v1.x. Give it a spin.

See https://github.com/desmondmorris/node-twitter/blob/master/README.md for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants