1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix typing of ExtensionStore.createInstance static (#6764)

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-12-15 13:29:43 -08:00 committed by GitHub
parent 15930d910f
commit fbaa9de007
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,12 +27,12 @@ export interface ExtensionStoreParams<T extends object> extends BaseStoreParams<
}
export abstract class ExtensionStore<T extends object> extends BaseStore<T> {
private static readonly instances = new WeakMap<object, ExtensionStore<object>>();
private static readonly instances = new WeakMap<object, any>();
/**
* @deprecated This is a form of global shared state. Just call `new Store(...)`
*/
static createInstance<T extends ExtensionStore<object>, R extends any[]>(this: StaticThis<T, R>, ...args: R): T {
static createInstance<T, R extends any[]>(this: StaticThis<T, R>, ...args: R): T {
return getOrInsertWith(ExtensionStore.instances, this, () => new this(...args)) as T;
}