medikoo / deferred

Modular and fast Promises implementation for JavaScript
ISC License
364 stars 20 forks source link

support for .fail() #35

Open PSeitz opened 10 years ago

PSeitz commented 10 years ago

a separate callback with .fail() would be cleaner instead a second parameter within done to catch rejected promises

medikoo commented 10 years ago

I understand you mean something like catch() but as counterpart for done().

There are definitely use cases for that. Is there any other library that implements fail()? I want to be sure it's really good name for that

PSeitz commented 10 years ago

Jquery uses this pattern, I think it's a proper name for a failure. http://api.jquery.com/deferred.fail/

medikoo commented 10 years ago

When we talk about promise implementations, jQuery is not perfect example to rely on, but I agree it's convincing argument in favor of name fail .

I think we'll do that, just give me 1-2 days, to settle with that idea.