108555: Refactored ItemSelectComponent to not call canSelect every time changes are detected

This commit is contained in:
Alexandre Vryghem
2024-04-18 19:33:42 +02:00
parent da31c4f253
commit 59197cff2d
5 changed files with 62 additions and 39 deletions

View File

@@ -0,0 +1,29 @@
import { Observable } from 'rxjs';
import { DSpaceObject } from '../../core/shared/dspace-object.model';
/**
* Class used to collect all the data that that is used by the {@link ObjectSelectComponent} in the HTML.
*/
export class DSpaceObjectSelect<T extends DSpaceObject> {
/**
* The {@link DSpaceObject} to display
*/
dso: T;
/**
* Whether the {@link DSpaceObject} can be selected
*/
canSelect$: Observable<boolean>;
/**
* Whether the {@link DSpaceObject} is selected
*/
selected$: Observable<boolean>;
/**
* The {@link DSpaceObject}'s route
*/
route: string;
}