For me one of the most powerful things about promises is that they can be
passed around, returned from functions, etc.. It seems like your way of
handlings errors prevents this. Or at least makes it very dangerous

Take the following code:

function* appendComment(id) {
  var user = dbHandle.load('user', { id: 'jen' });
  var thread = dbHandle.load('thread', { id: 1 });
  var comments = yield thread.getComments();
  // More code - but by yielding just before suddenly we might get an
  // uncatched error from the user promise in the first line.
}

We might have error handling further down - but it won't do us any good.
It seems like your approach removes some of the nice guarantees that 
promises
make compared to things like EventEmitters and callbacks.

On Friday, February 21, 2014 2:12:32 PM UTC-8, Rebecca Turner wrote:
>
> Yes, yet another promise library, it *is* getting a little old I know.
>
> https://www.npmjs.org/package/promisable
> https://github.com/iarna/promisable
>
> How exactly does this stand out from the dozens of other promise 
> implementations?
>
> * Errors have to be handled or they'll be thrown, saving you from having 
> to debug the phantom promise problem, eg:
>
> obj.thingThatPromises()
>     .then(function(v){ … });
>
> If the above is rejected then most (all?) other promise libraries would 
> just silently ignore it. With promisables it would throw the error, as you 
> didn't pass an error callback or use catch.
>
> * Very small code size compared to other promise implementations (4kb, one 
> file) due to taking a mostly functional point of view. OO bits are more 
> sugar then implementation. The other reason it remains small is that it 
> sticks just to implementing the promise abstraction.  It doesn't implement 
> combinators.  I'm of the opinion that combinators should go in separate 
> promise-library agnostic libraries.  (Why do you care that it's small? The 
> internals require less context to grasp.) 
>
> * Libraries that build on this library can easily offer multiple modes of 
> operation to allow users to pick the mode they're most comfortable with. 
>  Eg:
>
> library.asyncThing(callback) {
>     return Promisable.andMaybeCallback(callback,function(R){
>         doAsyncThing(R);
>     });
> }
>
> // And then a user can:
>
> library.asyncThing(function(e,value) { ... });
>
> library.asyncThing()
>        .then(function(value){ ... })
>        .catch(function(e){ ... });
>
> library.asyncThing()
>     (function(e,value){ ... });
>
> (Because the nodejs Google group apparently hates me, I'm reposting this 
> from another account. Hopefully the message will go through this time 
> instead of being eaten and shunted to the ether.)
>
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to