Package-level declarations

Functions

Link copied to clipboard
fun <T : Any> FetchFlow<T>.filterIsNotEmpty(): Flow<T>

Filter a FetchFlow by isNotEmpty, and unwrap the value if it exists.

Link copied to clipboard
inline fun <In : Out, Out : Any> FetchFlow<In>.flatMapFetching(crossinline transform: suspend Fetching<In>.() -> Fetch<Out>): FetchFlow<Out>

Map a fetch flow to flatMapFetching each emission.

Link copied to clipboard
inline fun <In : Out, Out : Any> FetchFlow<In>.flatMapFinished(crossinline transform: suspend Finished<In>.() -> Fetch<Out>): FetchFlow<Out>

Map a fetch flow to flatMapFinished each emission.

Link copied to clipboard
inline fun <In : Out, Out : Any> FetchFlow<In>.flatMapPrefetch(crossinline transform: suspend Prefetch.() -> Fetch<Out>): FetchFlow<Out>

Map a fetch flow to flatMapPrefetch each emission.

Link copied to clipboard

Map a fetch flow to flatten each emission.

Link copied to clipboard
inline fun <Data : Any, Output> FetchFlow<Data>.fold(crossinline prefetch: suspend Prefetch.() -> Output, crossinline fetching: suspend Fetching<Data>.() -> Output, crossinline finished: suspend Finished<Data>.() -> Output): Flow<Output>

Fold a FetchFlow into a Flow of Output.

Link copied to clipboard
inline fun <In : Out, Out : Any> FetchFlow<In>.mapFetching(crossinline transform: suspend Fetching<In>.() -> Out?): FetchFlow<Out>

Map a fetch flow to mapFetching each emission.

Link copied to clipboard
inline fun <In : Out, Out : Any> FetchFlow<In>.mapFinished(crossinline transform: suspend Finished<In>.() -> Out): FetchFlow<Out>

Map a fetch flow to mapFinished each emission.

Link copied to clipboard
inline fun <In : Out, Out : Any> FetchFlow<In>.mapToCache(crossinline transform: suspend Finished<In>.() -> Out = { result }): FetchFlow<Out>

Map a fetch flow to mapToCache each emission.

Link copied to clipboard
Link copied to clipboard

Map a fetch flow to maybe each emission.

Link copied to clipboard
Link copied to clipboard
inline fun <T : Any> FetchFlow<T>.onEach(crossinline prefetch: suspend Prefetch.() -> Unit = {}, crossinline fetching: suspend Fetching<T>.() -> Unit = {}, crossinline finished: suspend Finished<T>.() -> Unit = {}): FetchFlow<T>

On each emission, execute a lambda according to Fetch state.