Skip to content
This repository has been archived by the owner on Aug 25, 2018. It is now read-only.

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

Closed
jdub opened this issue May 8, 2011 · 10 comments
Closed

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

jdub opened this issue May 8, 2011 · 10 comments

Comments

@jdub
Copy link
Owner

jdub commented May 8, 2011

No description provided.

@gasi
Copy link

gasi commented May 10, 2011

+1

This issue and the mess the old cookie library creates in Express made me (temporarily) implement my own minimal Twitter client.

Have you considered taking advantage of some tools and libraries to make development easier and the code simpler?
Check out this implementation using CoffeeScript and Streamline.js:
https://github.com/gasi/node-twitter2/blob/develop/lib/twitter_.coffee

CoffeeScript gives us an abstraction for classes, string interpolation, etc. and Streamline really simplifies async code.

Let me know if you're interested in collaborating.

@jdub
Copy link
Owner Author

jdub commented May 10, 2011

Sorry, but I'd like to stick to straight JS and callbacks for node-twitter. It'd be nice if you renamed your repo so no one is confused about the relationship between node-twitter and your own library. Thanks.

(The cookie issue is being resolved at the moment -- see the pull request.)

@gasi
Copy link

gasi commented May 11, 2011

I respect your decision. Regarding the name, no worries, once your library doesn't rely on cookie and has standard callbacks, I'll probably kill mine. If I remember correctly, I read you mentioning to kill off the middleware & login part that relies on cookies. Is that true? I for one would welcome it very much.

Nice work on node-twitter :)

@jdub
Copy link
Owner Author

jdub commented May 11, 2011

I'll move it to a different module (included with node-twitter or separate, haven't decided).

@gasi
Copy link

gasi commented May 12, 2011

Cool, looking forward to check it out.

@ealdent
Copy link

ealdent commented May 16, 2011

+1 loving the library and this would be really nice to have

@jdub
Copy link
Owner Author

jdub commented Mar 16, 2012

Check out the request branch for a first cut of this. Every post-0.1.18 release will use the standard node callback pattern. :-)

@aseemk
Copy link

aseemk commented Apr 17, 2012

Sweet! Looking forward to it. Thanks @jdub.

@jdub
Copy link
Owner Author

jdub commented Apr 28, 2012

Just waiting on some fixes to request before merging the new request (and standard callback pattern) branch.

@gasi
Copy link

gasi commented Nov 19, 2014

Here json is returned as first argument, even though it is the success case:

callback(json);

Is this an oversight or did you decide not to use the callback(error, result) pattern?

P.S. Here I am, three years later, working for a different company and a different product and ran into the same issue. Made me chuckle seeing myself having commented on this back then 😉

/cc @aseemk

@jdub jdub closed this as completed Aug 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants