Skip to content

Deferred: Deprecate deferred.pipe(), isResolved(), isRejected() #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

dmethvin
Copy link
Member

@dmethvin dmethvin commented Apr 6, 2015

Ref #89
Fixes #97

This combines all the Deferred shims and uses the actual unit tests from jQuery for .pipe().

@dmethvin
Copy link
Member Author

@gibson042 and @jaubourg can you take a look? This PR takes a different approach, always patches .pipe() rather than doing it conditionally, and moves over the existing unit tests for .pipe(). My goal is to not require any other work here if we remove .pipe() in a later jQuery version.

var deferred = oldDeferred(),
promise = deferred.promise();

deferred.pipe = promise.pipe = function( /* fnDone, fnFail, fnProgress */ ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an extra space after the second "=", and the indentation looks wrong from here down.

@gibson042
Copy link
Member

This PR takes a different approach, always patches .pipe() rather than doing it conditionally, and moves over the existing unit tests for .pipe(). My goal is to not require any other work here if we remove .pipe() in a later jQuery version.

I wholeheartedly support all of the above. Minor comments provided, but the overall approach is solid.

@dmethvin dmethvin closed this in 876fd4e Apr 27, 2015
dmethvin added a commit that referenced this pull request Apr 28, 2015
Deferred was reimplemented using jQuery.Callbacks in 1.7 so this
skips the shim if we're on 1.6.4 which is currently supported.
Context behavior changed in 1.9 so don't make assertions on it.

Ref #101
@dmethvin dmethvin deleted the deferred-warnings branch November 21, 2015 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fill and warn for isResolved(), isRejected(), .pipe()
3 participants