This commit is contained in:
Niels Lyngsø
2024-01-26 13:28:37 +01:00
parent 4ae6fd049e
commit 1ac5b51715
2 changed files with 6 additions and 4 deletions

View File

@@ -73,7 +73,7 @@ export abstract class UmbBaseExtensionInitializer<
}
protected _init() {
this.#manifestObserver = this.observe(
this.#extensionRegistry.getByAlias<ManifestType>(this.#alias),
this.#extensionRegistry.byAlias<ManifestType>(this.#alias),
async (extensionManifest) => {
this.#clearPermittedState();
this.#manifest = extensionManifest;

View File

@@ -199,8 +199,7 @@ export class UmbExtensionRegistry<
) as unknown as Observable<Array<ExtensionType>>;
}
// TODO: get rid of the name get
getByAlias<T extends ManifestBase = ManifestBase>(alias: string) {
byAlias<T extends ManifestBase = ManifestBase>(alias: string) {
return this.extensions.pipe(
map((exts) => exts.find((ext) => ext.alias === alias)),
distinctUntilChanged(extensionSingleMemoization),
@@ -231,8 +230,11 @@ export class UmbExtensionRegistry<
distinctUntilChanged(extensionAndKindMatchSingleMemoization),
) as Observable<T | undefined>;
}
/**
* @deprecated Use `byAlias` instead.
*/
getByAlias = this.byAlias.bind(this);
// TODO: get rid of the name get
byTypeAndAlias<
Key extends keyof ManifestTypeMap<ManifestTypes> | string,
T extends ManifestBase = SpecificManifestTypeOrManifestBase<ManifestTypes, Key>,