#17863 closed enhancement (duplicate)
make this.own() handle Promises
Reported by: | bill | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | tbd |
Component: | Dijit | Version: | 1.9.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
If this.own() is called with a Promise, it should cancel() the Promise when the widget is destroyed.
It should also forget about the Promise if/when the Promise is resolved or rejected. It should detect when the Promise is resolved/rejected by using Promise.then(), rather than using dojo/aspect.
Actually using always() would be slightly simpler than using then(), but always() doesn't seem to be supported by the Promise spec (see for example https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise), so it's not very forward-compatible.
Note: See
TracTickets for help on using
tickets.
Actually, this was already reported in #17680... but the fix there needs to be improved so that Destroyable forgets about the Promise when it's resolved or rejected.