Improve API interoperability with standard Promise

Originally reported by @jzaefferer at: http://bugs.jquery.com/ticket/14510

Discussed this at the jQuery team meeting in Amsterdam: The spec is still changing a lot (within whatwg and draft pages on github), so we’ll wait for it to ship, unprefixed, not behind a flag, in stable browsers first.

Once that happened, we should change/fix our implementation to match the spec (and shipped implementation).

Can use .pipe() to continue using any jQuery-specific functionality.

Author: Fantashit

1 thought on “Improve API interoperability with standard Promise

  1. Author: anonymous

    .then() can be built from .done() but not the other way around.

    This is false.

    Promise.prototype.done = (onFulfilled, onRejected) {
      this.then(onFulfilled, onRejected).catch(e => setTimeout(() => throw e, 0));
    };
    

Comments are closed.