byAlias
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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>,
|
||||
|
||||
Reference in New Issue
Block a user