fetch
fun <T : Any> fetch(timeout: Duration = Duration.INFINITE, recover: FetchCollector<T>.(Throwable) -> Fetch<T> = { throw it }, block: suspend FetchCollector<T>.() -> T): FetchFlow<T>
Create a new FetchFlow with the given block of code to execute.
However, you can manually emit these statuses via emit, prefetch, fetching, and finished.
Return
Parameters
T
The type of the result of the fetch.
timeout
The duration to wait withTimeout for the fetch block to complete once.
block
The block of code to execute.