4 ms·
Show HN: And then...
- aravindet 13y agoIf you have any questions, I'm hanging out on http://askabt.com/andthen http://askabt.com/andthen (realtime chat).
- gjsrivastava 13y agoAwesome
- losethos 13y agoI don't have any programming "itches" I want to scratch. I've done all I want. I did a 3D printer, so I have no interest in robotics. I did SimStucture, so I have no interest in Control Systems. I did a compiler. I did songs. I would like to do more songs. I'm waiting for God to do something. Might be waiting a long time, like Jews waiting to be rescued from Hitler. God says... honoured pestilent ten pant immoderate essayed remainest steer refreshing plainer opinionative sensitive especially tumult be silent threads painful unwholesome tamer propound odour awaiting demanding ipod INDIRECT These disguise dry short Lastly forbade commanding martyrs hateful Welcome beholding teaching allegorically blamed eye token obtaining inclined known Abraham's provisions labours waterest cubits fruitlessly copy engage guess thunder suffering conversing tempted 91 sentences -who arms thing's supplies human ball shaken bold-faced sleepest Electronic favour recess folk disputing Ministry corrupted explanatory handkerchief varieties others' displays contention medicine Run blind Isn't_that_special sun's adversary forth notion likest fears bathe male notices equals let's_see torture FTP lecture wickedness scourges participation talked reckon Maker broad believe- last vouchsafed lineaments cane No bottom betters claim Else suspect multipliedst formedst Stop thirsteth consistently anxiously version exceedeth us blesses silent carried compressed beautified please purged mainly dashed Themselves adoption large impudently nominally foolishly forsaking sings growth churches substance Give lecture ascension requital contempt enjoin IV powerful direction What more could you ask for than opportunity to pursue all your passions until they bore you. I guess success might be nice, but highs and lows balance. The alternative is more brilliant ideas in your old age, perhaps.
- mohitraj 13y agointeresting...
- hittudiv 13y agolooks awesome
- harry_softer 13y agoImpressive..........
- Mehul981 13y agoits simple and small
- aravindet 13y agoYeah, barely 1.3 kb minified if you're using it on the client side. It's also compatible with JQuery deferred's.
- harry_softer 13y agoAwesome... I think this will help me deal with all the nested event handlers when I work on complex UI using jquery........ Will be really handy...
- jhrobert 13y agoCompatible with jQuery deferred? Only if you consider that it is compatible to miss P.Deferred(), P.promise(), P.when(), parole.state(), parole.progress(), parole.done(), parole.fail() and parole.always() I tend to know about that because I am currently writing a lib that is going to be both Q and jQuery compatible: https://github.com/JeanHuguesRobert/l8/wiki/ParoleReference https://github.com/JeanHuguesRobert/l8/wiki/ParoleReference
- jessy_indya 13y agoCan't wait to try it out!!
- kartikeya_rokde 13y agogreat work..!!
- Mehul981 13y agoI also like this: http://askabt.com/andthen http://askabt.com/andthen I think its kinda forum, who's running this?
- gjsrivastava 13y agoIts chat blended in forum and you can embed it any where :)
- dbaupp 13y agoThere seems to be a large number of new users (a few of which were created within 5 minutes of this submission) who've only commented on this, and very vacuously.
- scott_s 13y agoYes. They smell like puppets.
- aravindet 13y agoThis went out on FB and Twitter. I guess people who came from there weren't HN users. Hopefully they are now. I agree about the comment quality though, I was hoping for a discussion about the idea itself.
- blowski 13y agoThe idea is good, but I can't see why I would switch to this from Q.js. The latter is: * pretty lightweight (9.8KB) * well-supported, with very active development (10 commits in the last month) * good documentation You need to explain the benefits of .andthen() in comparison to Q.js, because at the moment it just looks like another promises JS framework.
- aravindet 13y agoI think the benefit is primarily a simpler API and nicer syntax for most of the things you'd want to do. For instance with Q.all, you'd do with: return Q.all([ eventualAdd(2, 2), eventualAdd(10, 20) ]).then(function(values) { console.log(values[0], values[1]); }); can instead be eventualAdd(2, 2). and(eventualAdd(10,20)). then(function(a, b) { console.log(a, b); }); which I feel reads nicer and gives you the results in a more usable form (something that would require another call, Q.spread, in Q). This also allows complex composition. Say you want to run 4 functions A, B, C and D, such that A and B are called together, C is called when A returns, then D is called when B and C both return. This is clumsy to do on Q, requiring packing promises into an array, etc. The other big thing is error handling. In Q, if you forget to set an error handler at the end of the chain or explicitly set the default handler with .done(), errors go unhandled. This is clumsy; in fact the Q documentation says: "This is a stopgap. We are exploring ways to make unhandled errors visible without any explicit handling." We've implemented this in andthen. If there's no error handler and execution reached the end of the chain, it will be thrown so Node or the browser will print it. There's fulfilment as well, but I get your point about putting this better in the README.
- jeremi23 13y agoHow does it compare with Q.js ?
- jhrobert 13y agop1.and( p2 ).then( function( p1_result, p2_result ){...}); I believe this is equivalent to: Q.all( p1, p2 ).spread( function( p1_result, p2_result ){ ... } ); There are other good reasons, at this point, to switch from Q to another promise lib, speed for example, as was virulently signaled recently: http://jsperf.com/wqfwewefewrw/4 http://jsperf.com/wqfwewefewrw/4
- perlgeek 13y agoI like the idea, but am I the only one who feels that having a method 'and' feels a little too... cute? I mean, it's not at all obvious that 'and' is related to parallel execution, and it could very easily clash with another library that uses the same name.