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:
parent
15930d910f
commit
fbaa9de007
@ -27,12 +27,12 @@ export interface ExtensionStoreParams<T extends object> extends BaseStoreParams<
|
|||||||
}
|
}
|
||||||
|
|
||||||
export abstract class ExtensionStore<T extends object> extends BaseStore<T> {
|
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(...)`
|
* @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;
|
return getOrInsertWith(ExtensionStore.instances, this, () => new this(...args)) as T;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user