mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
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:
1 parent
63f6562e0a
commit
ab130b586e
6 files changed
+617
-439
No files matched your search
@@ -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;
|
||||
}
|
||||
@@ -19,3 +19,4 @@ export * from "./downloadFile";
|
||||
export * from "./escapeRegExp";
|
||||
export * from "./tar";
|
||||
export * from "./type-narrowing";
|
||||
export * from "./disposer";
|
||||
Reference in new issue
Block a user