Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2468)

Unified Diff: dashboard/dashboard/static/simple_xhr.html

Issue 2756573004: [Dashboard] Formalize SeriesGroup (Closed)
Patch Set: JSON.parse oops Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dashboard/dashboard/static/series_group_test.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dashboard/dashboard/static/simple_xhr.html
diff --git a/dashboard/dashboard/static/simple_xhr.html b/dashboard/dashboard/static/simple_xhr.html
index 4e595f9bd02a7deea07a429966a37b58d0a93993..f9a353a5635d350cbe8da50d091d46bdc0e9f2c3 100644
--- a/dashboard/dashboard/static/simple_xhr.html
+++ b/dashboard/dashboard/static/simple_xhr.html
@@ -11,7 +11,7 @@ found in the LICENSE file.
// This variable name is supposed to not be camelCased, in order for it
// to match up with the file name.
// eslint-disable-next-line
-var simple_xhr = (function() {
+var simple_xhr = (function() {
var LOGIN_ERROR_MESSAGE = 'Please check if you are logged in with a ' +
'google.com or chromium.org account in the ' +
@@ -66,9 +66,14 @@ var simple_xhr = (function() {
return request;
};
- return {
- send: send
+ var asPromise = function(url, params) {
+ return new Promise((resolve, reject) => {
+ simple_xhr.send(
+ url, params, response => resolve(response), error => reject(error));
+ });
};
+
+ return {asPromise, send};
})();
</script>
« no previous file with comments | « dashboard/dashboard/static/series_group_test.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698