julianshapiro/velocity — pull request #87 by ydaniv (2014-05-29 09:35:52+00:00)
Title: Promises initial implementation

This is a first attempt. Still not quite sure about API design.

What's in there:

* `veocity.defaults.promise`: `false` by default and if set to `true` it will always return a promise.
* `options.promise`: if set to `true` then a promise is returned for that call.
* Works with basic `$.fn.velocity()` calls and also using an action, e.g. `slideUp`.
* Bad calls to `$.fn.velocity()` return a rejected promise.
* Works with native Promises by default. Can be overridden by setting `velocity.Promise` to a constructor that behaves the same.
* All resolved and rejected promises return the call's context elements as value/reason.

Example: http://jsfiddle.net/faa8e/

Not in there:

* Support for progress notifications.
* jQuery.Deferred() integration.