Commit 556a3cae authored by Jesse Schettler's avatar Jesse Schettler Committed by Commit Bot

scanning: Use arrow functions to call into callbacks

Using arrow functions is recommended over binding since arrow functions
permit explicitly specifying which parameters to pass to the callbacks.

Bug: 1059779
Change-Id: I25279d8e39f6635a41719e794620c76ee956545f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2457406Reviewed-by: default avatarJimmy Gong <jimmyxgong@chromium.org>
Commit-Queue: Jesse Schettler <jschettler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814963}
parent 5034c8b9
...@@ -85,7 +85,10 @@ Polymer({ ...@@ -85,7 +85,10 @@ Polymer({
/** @override */ /** @override */
ready() { ready() {
this.scanService_.getScanners().then(this.onScannersReceived_.bind(this)); this.scanService_.getScanners().then(
/*@type {!{scanners: !ScannerArr}}*/ (response) => {
this.onScannersReceived_(response);
});
}, },
/** /**
...@@ -137,7 +140,12 @@ Polymer({ ...@@ -137,7 +140,12 @@ Polymer({
this.scanService_ this.scanService_
.getScannerCapabilities(this.scannerIds_.get(selectedScannerId)) .getScannerCapabilities(this.scannerIds_.get(selectedScannerId))
.then(this.onCapabilitiesReceived_.bind(this)); .then(
/*@type {!{capabilities:
!chromeos.scanning.mojom.ScannerCapabilities}}*/
(response) => {
this.onCapabilitiesReceived_(response);
});
}, },
/** @private */ /** @private */
...@@ -163,7 +171,8 @@ Polymer({ ...@@ -163,7 +171,8 @@ Polymer({
.scan(this.scannerIds_.get(this.selectedScannerId), settings) .scan(this.scannerIds_.get(this.selectedScannerId), settings)
.then( .then(
/*@type {!{success: boolean}}*/ (response) => { /*@type {!{success: boolean}}*/ (response) => {
this.onScanCompleted_(response)}); this.onScanCompleted_(response);
});
}, },
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment