behance/nbd.js — pull request #55 by Aintaer (2014-01-04 06:21:25+00:00)
Title: Promise: convenience methods

.kept(), .broken(), and .eitherWay() for what amounts to .done(),
.fail(), and .always(), albeit with different semantics.

The jQuery methods accept any number of arguments and do not return a
new promise object (due to it being impossible to return a single new
promise when given multiple callbacks).

nbd's .kept, .broken and .eitherWay methods are NOT context safe, unlike
its .resolve, .reject and .then methods. They are all convenience
wrappers for .then. They DO return a new promise. They DO NOT take
multiple arguments.

The concept of a promise chain is more important to nbd promises than
jQuery Deferreds, therefore we make the effort to keep the chain going.
If jQuery's behavior is desired, you can still use .promise() to get a
context safe object that behaves like $.Deferred.

Fixes #46