FlowFactoryWithNoInput
class FlowFactoryWithNoInput<TData, TError : Throwable>(cache: OnHandCache, cacheKey: CacheableInput.FlowInput, dispatcher: CoroutineDispatcher = Dispatchers.Default, ttl: Duration? = null, flow: () -> Flow<TData>)
Factory for creating CacheableFlowWithNoInput instances.
The flow lambda runs on Dispatchers.Default. Do not use launch or async inside the lambda without awaiting — the flow collection must complete sequentially so that state transitions (LOADING → SUCCESS/ERROR) are correct.
Constructors
Link copied to clipboard
constructor(cache: OnHandCache, cacheKey: CacheableInput.FlowInput, dispatcher: CoroutineDispatcher = Dispatchers.Default, ttl: Duration? = null, flow: () -> Flow<TData>)
Functions
Link copied to clipboard
fun create(coroutineScope: CoroutineScope, initialFetchState: FetchState = FetchState.IDLE): CacheableFlowWithNoInput<TData, TError>
Link copied to clipboard
operator fun invoke(coroutineScope: CoroutineScope, initialFetchState: FetchState = FetchState.IDLE): CacheableFlowWithNoInput<TData, TError>
Link copied to clipboard
fun optimisticUpdater(updater: (currentValue: TData?) -> TData): Map<CacheableInput.FlowInput, TData?>