Package-level declarations
Types
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class ReturnOnErrorCall<T : Any>(originalCall: Call<T>, scope: CoroutineScope, onErrorReturn: suspend (originalError: StreamError) -> Result<T>) : Call<T>
A wrapper around Call that swallows the error and emits new data from onErrorReturn.
Link copied to clipboard
The CoroutineContext.Element which holds ongoing calls until those get finished.
Functions
Link copied to clipboard
Forces a regular call to be used instead of DistinctCall.
Link copied to clipboard
fun <T : Any> Call<T>.onErrorReturn(scope: CoroutineScope, function: suspend (originalError: StreamError) -> Result<T>): ReturnOnErrorCall<T>
Wraps this Call into ReturnOnErrorCall to return an item specified by side effect function when it encounters an error.
Link copied to clipboard
Link copied to clipboard
fun <T : Any> Call<T>.withPrecondition(scope: CoroutineScope, precondition: suspend () -> Result<Unit>): Call<T>
Run the Call if the given precondition is Result.Success.