Refactor the Extensions settings page

- Simplify the install logic by refactoring out the multi-install logic

- Revamp the ExtensionInstallStateStore to more strictly track the
  lifetime of an install or uninstall request

- Fix the install of an already installed extension just hanging
  visually

- Display a spinner more often for more visual feedback

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2021-04-06 10:28:24 -04:00
1 parent 63f6562e0a
commit ab130b586e
6 files changed
+617 -439

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
export type Disposer = () => void;
interface Extendable<T> {
push(...vals: T[]): void;
}
export function disposer(...args: Disposer[]): Disposer & Extendable<Disposer> {
const res = () => {
args.forEach(dispose => dispose?.());
args.length = 0;
};
res.push = (...vals: Disposer[]) => {
args.push(...vals);
};
return res;
}
+1
View File
@@ -19,3 +19,4 @@ export * from "./downloadFile";
export * from "./escapeRegExp";
export * from "./tar";
export * from "./type-narrowing";
export * from "./disposer";