Open
Bug 1055248
Opened 12 years ago
Updated 4 years ago
Device Storage - Use promises or callbacks passed as parameters for consistency with other APIs
Categories
(Core :: DOM: Core & HTML, defect, P5)
Tracking
()
NEW
People
(Reporter: dmarcos, Unassigned)
Details
The current API returns a request object where the user is expected to attach the callbacks:
var req = navigator.getDeviceStorage('pictures').addNamed(blob, filepath);
req.onerror = function() { ... };
req.onsuccess = function() { ... };
We should be using either callbacks passed as a parameter: It's a better indicator for the user that the operation is asynchronous
navigator.getDeviceStorage('pictures').addNamed(blob, filepath, onsuccess, onerror);
Or we could use promises instead:
navigator.getDeviceStorage('pictures').addNamed(blob, filepath).then(onsuccess, onerror);
The two options above are fine to me but we should make sure that we follow the same pattern than other modern APIs. Promises seems the direction we're taking.
| Reporter | ||
Updated•12 years ago
|
Summary: Device Storage - Update the API for consistency with other APIs → Device Storage - Use promises or callbacks passed as parameters for consistency with other APIs
Comment 1•8 years ago
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046
Move all DOM bugs that haven't been updated in more than 3 years and has no one currently assigned to P5.
If you have questions, please contact :mdaly.
Priority: -- → P5
| Assignee | ||
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
Updated•4 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•