distinctUntilChangedBy

@FlowPreview fun <T, K> Flow<T>.distinctUntilChangedBy(
    keySelector: (T) -> K
): Flow<T>
(source)

Returns flow where all subsequent repetitions of the same key are filtered out, where key is extracted with keySelector function.