allow for undefined

This commit is contained in:
Niels Lyngsø
2025-01-24 11:36:40 +01:00
parent b8928bac0b
commit fb3609db0a
2 changed files with 5 additions and 7 deletions

View File

@@ -76,8 +76,8 @@ export class UmbRepositoryItemsManager<ItemType extends { unique: string }> exte
return this.#uniques.getValue();
}
setUniques(uniques: string[]): void {
this.#uniques.setValue(uniques);
setUniques(uniques: string[] | undefined): void {
this.#uniques.setValue(uniques ?? []);
}
getItems(): Array<ItemType> {

View File

@@ -221,7 +221,7 @@ export type UmbSorterConfig<T, ElementType extends HTMLElement = HTMLElement> =
Partial<Pick<INTERNAL_UmbSorterConfig<T, ElementType>, 'ignorerSelector' | 'containerSelector' | 'identifier'>>;
/**
* @class UmbSorterController
* @implements {UmbControllerInterface}
* @description This controller can make user able to sort items.
@@ -346,10 +346,8 @@ export class UmbSorterController<T, ElementType extends HTMLElement = HTMLElemen
}
}
setModel(model: Array<T>): void {
if (this.#model) {
this.#model = model;
}
setModel(model: Array<T> | undefined): void {
this.#model = model ?? [];
}
/**