mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
* Fix: logs data disapearing causing crashes (#2566) Signed-off-by: Sebastian Malton <sebastian@malton.name> * Refactor helm-chart.api and improve kube validation and error handling (#2265) Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix: HPA's not sortable by age (#2565) Signed-off-by: Sebastian Malton <sebastian@malton.name> * Conditionally render status icon for kube meta (#2298) Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix custom resource loading spinner appears above extensions' cluster menus (#2344) Signed-off-by: Sebastian Malton <sebastian@malton.name> * Lens should point to the release docs (#2268) Signed-off-by: Sebastian Malton <sebastian@malton.name> * Refactor the Extensions settings page (#2221) Signed-off-by: Sebastian Malton <sebastian@malton.name> * try and get jest to not core dump Signed-off-by: Sebastian Malton <sebastian@malton.name>
21 lines
405 B
TypeScript
21 lines
405 B
TypeScript
export type Disposer = () => void;
|
|
|
|
interface Extendable<T> {
|
|
push(...vals: T[]): void;
|
|
}
|
|
|
|
export type ExtendableDisposer = Disposer & Extendable<Disposer>;
|
|
|
|
export function disposer(...args: Disposer[]): ExtendableDisposer {
|
|
const res = () => {
|
|
args.forEach(dispose => dispose?.());
|
|
args.length = 0;
|
|
};
|
|
|
|
res.push = (...vals: Disposer[]) => {
|
|
args.push(...vals);
|
|
};
|
|
|
|
return res;
|
|
}
|