Updated on 2026-08-14
This commit is contained in:
parent
3d3a7771a5
commit
4edbc8d918
28 changed files with 400 additions and 81 deletions
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue