sanitizeSelection

fun sanitizeSelection(availableItems: Flow<List<T>>, data: CollectionData<T>)

Calling this function will connect the provided Flow of List of T with the current selection flow (one single item T for mode single and some List of T for mode multi). On every change of the external items flow, the current selection will be sanitized in the following way: If the selection contains some item, that is not part of the items flow, it will be removed from the selection.

As the DataCollection is primarily used for handling (large) portions of data, it is totally reasonable to provide only those data within the selection, that is currently part of the shown data of the collection.

Parameters

availableItems

some Flow of List of T with the available items.