cache¶
fun <Identifier, Failure, Value> cache(transform: suspend (Identifier) -> Outcome<Failure, Value>): Cache<Identifier, Failure, Value>
@JvmName(name = "infallibleCache")
fun <Identifier, Value> cache(transform: suspend (Identifier) -> Value): InfallibleCache<Identifier, Value>
Cache implementation which calls a given transform suspending function.
The transform function is considered always successful. This allows to bypass the cache's error encoding. For more information, see InfallibleCache.
This adapter is meant to be used as the first layer in a layer chain. By itself, it does no caching (all calls to get call transform). To learn more about layer chaining, or about the type parameters, see Cache.