sharedFlowCache

fun <K : Any, V> sharedFlowCache(scope: CoroutineScope, started: SharingStarted = SharingStarted.WhileSubscribed(), replay: Int = 0): SharedFlowCache<K, V>(source)

Creates a SharedFlowCache - a keyed cache of plain SharedFlows, one shared upstream per key, each evicted once its upstream ends (see SharedFlowCache).

Parameters

scope

parent scope; each key's sharing coroutine is a child of it.

started

the SharingStarted strategy applied to each key's upstream.

replay

number of values replayed to new subscribers of a key.