Updated on 2026-08-14

This commit is contained in:
Tangem 2025-07-07 14:13:42 +04:00
parent 3d3a7771a5
commit 4edbc8d918
28 changed files with 400 additions and 81 deletions

View file

@ -1,6 +1,7 @@
package com.tangem.domain.core.flow
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.firstOrNull
/**
* [Flow] supplier
@ -14,4 +15,9 @@ interface FlowSupplier<Params : Any, Data : Any> {
/** Supply [Flow] by [params] */
operator fun invoke(params: Params): Flow<Data>
/** Get first [Data] by [params] or null if [Flow] is empty */
suspend fun getSyncOrNull(params: Params): Data? {
return invoke(params).firstOrNull()
}
}