Closed
Bug 1033967
Opened 11 years ago
Closed 9 years ago
Use DOM Promises for MozLoopAPI functions where callbacks are currently used
Categories
(Hello (Loop) :: Client, defect, P4)
Hello (Loop)
Client
Tracking
(Not tracked)
RESOLVED
WONTFIX
backlog | tech-debt |
People
(Reporter: standard8, Unassigned)
References
Details
(Whiteboard: [tech-debt])
Attachments
(1 file)
2.85 KB,
text/plain
|
Details |
We should use DOM promises for the MozLoopAPI functions which are currently based around callbacks.
The main functions to swap are currently ensureRegistered and hawkRequest.
Switching to use DOM promises isn't too difficult in itself (see example patch), the slightly more complicated bit is integrating into the Mocha & chai tests. There's information on that here:
For the records Mocha supports promises; quoting http://visionmedia.github.io/mocha/#asynchronous-code:
> Alternately, instead of using the done() callback, you can return a promise.
They also use https://github.com/domenic/chai-as-promised/ to extend the Chai expectation API.
Reporter | ||
Comment 1•11 years ago
|
||
(In reply to Mark Banner (:standard8) from comment #0)
> They also use https://github.com/domenic/chai-as-promised/ to extend the
> Chai expectation API.
Additional xref http://chaijs.com/plugins/chai-as-promised
Updated•10 years ago
|
backlog: --- → -
Updated•10 years ago
|
backlog: - → tech-debt
Priority: -- → P4
Whiteboard: [tech-debt]
Reporter | ||
Comment 3•9 years ago
|
||
I'm wontfixing this, as we're changing the MozLoopAPI due to e10s to use a message passing mechanism, and this is unlikely to fit with promises.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•