Closed
Bug 852531
Opened 11 years ago
Closed 11 years ago
[New Tab Page] use promises to wait for a batch of operations to complete
Categories
(Firefox :: Tabbed Browser, defect)
Firefox
Tabbed Browser
Tracking
()
RESOLVED
FIXED
Firefox 22
People
(Reporter: ttaubert, Assigned: ttaubert)
Details
Attachments
(1 file)
7.83 KB,
patch
|
Yoric
:
review+
|
Details | Diff | Splinter Review |
We didn't have Promises when I built the new tab page so I came up with something similar in newtab/batch.js. I'd like to remove that code and just use Promises like: Promise.all(promise1, promise2, promise3, ..., promiseN)
Assignee | ||
Comment 1•11 years ago
|
||
Attachment #726659 -
Flags: review?(dteller)
Comment 2•11 years ago
|
||
Comment on attachment 726659 [details] [diff] [review] use promises to wait for a batch of operations to complete Review of attachment 726659 [details] [diff] [review]: ----------------------------------------------------------------- I believe that you are going to be the first user of Promise.promised outside of addon-sdk, so I will be waiting for the try results :) ::: browser/base/content/newtab/transformations.js @@ +180,5 @@ > return; > > + let deferred = Promise.defer(); > + batch.push(deferred.promise); > + let cb = function () deferred.resolve(); Remark: Actually, |deferred.resolve| is probably sufficient, but you are right to not rely on this.
Attachment #726659 -
Flags: review?(dteller) → review+
Assignee | ||
Comment 3•11 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=469757933782
Assignee | ||
Comment 4•11 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/f6e7195e87db
Assignee | ||
Comment 5•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/f6e7195e87db
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 22
You need to log in
before you can comment on or make changes to this bug.
Description
•