#15902 closed defect (wontfix)
Deferred has no always() method
Reported by: | bill | Owned by: | Mark Wubben |
---|---|---|---|
Priority: | undecided | Milestone: | tbd |
Component: | Core | Version: | 1.8.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
The doc for Promise says that it has an always() ethod, but it doesn't.
I saw this when trying to update Tree to use this.pendingCommandsDeferred.always() rather than this.pendingCommandsDeferred.then(), but the problem can be reproduced simply by:
require(["dojo/Deferred"], function(Deferred){ console.log( (new Deferred()).always ); })
Also, the API doc marks the callback parameter as optional, but presumably it's not. always() is meaningless, right?
Attachments (1)
Change History (7)
comment:1 Changed 10 years ago by
Owner: | set to Mark Wubben |
---|---|
Status: | new → assigned |
Changed 10 years ago by
Attachment: | Tree_use_always.patch added |
---|
comment:2 Changed 10 years ago by
Description: | modified (diff) |
---|
comment:3 Changed 10 years ago by
comment:4 Changed 10 years ago by
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
Utility methods are on promises, not on the deferreds. You could use this.pendingCommandsDeferred.promise.always()
.
The callback is optional so far as that no errors are thrown if it's missing, but obviously it'd mean the resulting promise won't be resolved with any value.
comment:5 Changed 10 years ago by
Surely the callback is mandatory. What exactly would always() with no argument do?
comment:6 Changed 10 years ago by
Following <https://github.com/dojo/dojo/blob/master/Deferred.js#L32>, it's effectively a noop that just creates a new promise. Like calling deferred.then()
.
In [29577]: