microsoft / microsoft/vscode-python-environments

SimpleDebounce should be a disposable

Offen
#954 2 Kommentare 1 Reaktion 3 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

debt needs PR
Vorherrschende Sprache
TypeScript
Sterne
138
Forks
62
Ø Merge
1 T. 4 Std.
Gemergte PRs (30 T.)
35

Beschreibung

This should be disposable:

https://github.com/microsoft/vscode-python-environments/blob/baad0daaa2e01f31ba507176e889bdfaf30d4cff/src/common/utils/debounce.ts#L1-L23

`dispose`'s impl should be:

```ts
public dispose() {
if (this.timeout) {
clearTimeout(this.timeout);
}
}
```

Not having this means that if the debouncer's job is done while the `setTimeout` is active, it will still fire again.

An example of this in practice is if the extension is disabled it should immediately dispose everything. Another example is the transient usage in https://github.com/microsoft/vscode-python-environments/pull/952

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.