Side navigation
#8856 closed enhancement (fixed)
Opened April 12, 2011 11:11PM UTC
Closed September 22, 2011 02:49PM UTC
Last modified May 08, 2012 08:31PM UTC
Request: deferred.isUnresolved()
Reported by: | giskard22 | Owned by: | jaubourg |
---|---|---|---|
Priority: | blocker | Milestone: | 1.7 |
Component: | deferred | Version: | 1.5.2 |
Keywords: | 1.7-discuss | Cc: | |
Blocked by: | Blocking: |
Description
Sometimes I want to see if a Deferred is still pending. I have to do:
if (def.isResolved() || def.isRejected()) ...
It would be easier to just check def.isUnresolved().
Attachments (0)
Change History (20)
Changed April 15, 2011 05:00AM UTC by comment:1
component: | unfiled → deferred |
---|---|
priority: | undecided → low |
Changed April 16, 2011 09:46PM UTC by comment:2
Let's consider this for 1.7.
Changed April 17, 2011 07:36AM UTC by comment:3
milestone: | 1.next → 1.7 |
---|---|
status: | new → open |
Changed April 17, 2011 11:35PM UTC by comment:4
I'd vote for isPending()
Changed April 17, 2011 11:42PM UTC by comment:5
milestone: | 1.7 → 1.next |
---|
Changed May 22, 2011 07:27PM UTC by comment:6
keywords: | → 1.7-discuss |
---|
Nominating ticket for 1.7 discussion.
Changed May 22, 2011 09:28PM UTC by comment:7
description: | Sometimes I want to see if a Deferred is still pending. I have to do: \ \ {{{ \ if (def.isResolved() || def.isRejected()) ... \ }}} \ \ It would be easier to just check def.isUnresolved(). → Sometimes I want to see if a Deferred is still pending. I have to do:\ \ {{{\ if (def.isResolved() || def.isRejected()) ...\ }}}\ \ It would be easier to just check def.isUnresolved(). |
---|
+1,
Changed May 23, 2011 12:38AM UTC by comment:8
+1, when a deferred is rejected then it is unresolved. Better call this isPending or something.
Changed May 23, 2011 04:28AM UTC by comment:9
+1,
Changed May 24, 2011 09:29PM UTC by comment:10
description: | Sometimes I want to see if a Deferred is still pending. I have to do:\ \ {{{\ if (def.isResolved() || def.isRejected()) ...\ }}}\ \ It would be easier to just check def.isUnresolved(). → Sometimes I want to see if a Deferred is still pending. I have to do: \ \ {{{ \ if (def.isResolved() || def.isRejected()) ... \ }}} \ \ It would be easier to just check def.isUnresolved(). |
---|
+1, Definitely.
Changed June 03, 2011 01:53PM UTC by comment:11
description: | Sometimes I want to see if a Deferred is still pending. I have to do: \ \ {{{ \ if (def.isResolved() || def.isRejected()) ... \ }}} \ \ It would be easier to just check def.isUnresolved(). → Sometimes I want to see if a Deferred is still pending. I have to do:\ \ {{{\ if (def.isResolved() || def.isRejected()) ...\ }}}\ \ It would be easier to just check def.isUnresolved(). |
---|
+0, Don't have strong feelings regarding this.
Changed June 04, 2011 10:18PM UTC by comment:12
+1
Changed June 05, 2011 09:29PM UTC by comment:13
description: | Sometimes I want to see if a Deferred is still pending. I have to do:\ \ {{{\ if (def.isResolved() || def.isRejected()) ...\ }}}\ \ It would be easier to just check def.isUnresolved(). → Sometimes I want to see if a Deferred is still pending. I have to do: \ \ {{{ \ if (def.isResolved() || def.isRejected()) ... \ }}} \ \ It would be easier to just check def.isUnresolved(). |
---|
+1, and we should use the name isUnresolved to maintain the dichotomy
Changed July 12, 2011 03:03PM UTC by comment:14
milestone: | 1.next → 1.7 |
---|---|
priority: | low → blocker |
Changed July 12, 2011 03:38PM UTC by comment:15
owner: | → jaubourg |
---|---|
status: | open → assigned |
Changed September 09, 2011 09:49PM UTC by comment:16
An other possibility: ! def.isResolved()
Changed September 22, 2011 02:49PM UTC by comment:17
resolution: | → fixed |
---|---|
status: | assigned → closed |
It's called isProgressing and is in master.
Related commit: https://github.com/jquery/jquery/commit/a588336a6dcc6f29e870e8fcdd243f96bec5e833
Changed September 22, 2011 10:41PM UTC by comment:18
It may be subtle, but I think .isProgressing()
has a different implication than .isUnresolved()
. The former implies some sort of progress is still being made, whereas the latter just says it's not yet done.
Changed September 23, 2011 06:53AM UTC by comment:19
Replying to [comment:18 dmethvin]:
It may be subtle, but I think.isProgressing()
has a different implication than.isUnresolved()
. The former implies some sort of progress is still being made, whereas the latter just says it's not yet done.
While .isProgressing() returns true, you can still notify progress (for progress callbacks). I'm just trying to be consistant with the rest of the API:
- isResolved(): .resolve() has been called
- isRejected(): .reject() has been called
- isProgressing(): progress callback can be trigerred
-ed for one-time actions, -ing for repeatable callbacks with an emphase on the callback type.
I'm strictly against isUnresolved, seeing as it is completely misleading (shouldn't it return true when the deferred is rejected?).
Changed May 08, 2012 08:31PM UTC by comment:20
Clarifying: The actual resolution in 1.7 was to add a .state
to the Deferred. The .isResolved()
and .isRejected()
methods are deprecated and will be removed in 1.8.