package llc.arma.ble.domain.usecase.filter

import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
import llc.arma.ble.domain.model.BleFilter
import llc.arma.ble.domain.repository.SettingsRepository
import javax.inject.Inject

class GetFilterFlow @Inject constructor(
    private val settingsRepository: SettingsRepository
) {

    operator fun invoke(): Flow<BleFilter> {
        return settingsRepository.getFilterFlow().map {
            it ?: BleFilter()
        }
    }

}