mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-01 17:57:36 +08:00
[ts] Type-check ui/ThrottledWidget.js with TypeScript
R=aerotwist@chromium.org Bug: chromium:1011811 Change-Id: Id8af2424186597f679dd08d87e137441b84d546b Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2351786 Reviewed-by: Paul Lewis <aerotwist@chromium.org> Commit-Queue: Simon Zünd <szuend@chromium.org>
This commit is contained in:
@@ -2,9 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @ts-nocheck
|
||||
// TODO(crbug.com/1011811): Enable TypeScript compiler checks
|
||||
|
||||
import * as Common from '../common/common.js';
|
||||
import {VBox} from './Widget.js';
|
||||
|
||||
@@ -33,19 +30,13 @@ export class ThrottledWidget extends VBox {
|
||||
if (this._updateWhenVisible) {
|
||||
return;
|
||||
}
|
||||
this._updateThrottler.schedule(innerUpdate.bind(this));
|
||||
|
||||
/**
|
||||
* @this {ThrottledWidget}
|
||||
* @return {!Promise<?>}
|
||||
*/
|
||||
function innerUpdate() {
|
||||
this._updateThrottler.schedule(() => {
|
||||
if (this.isShowing()) {
|
||||
return this.doUpdate();
|
||||
}
|
||||
this._updateWhenVisible = true;
|
||||
return Promise.resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user