<Clearing SharedFlow: Converting flow to mutableFl...
# stackoverflow
u
Clearing SharedFlow: Converting flow to mutableFlow I've an API that returns flow which I'm converting to sharedFlow using shareIn(). I've a use case where I want to reset the cached value in the sharedFlow and force the flow to fetch new data. We've a resetReplayCache() however it's only available for MutableSharedFlow. class User { val _flow = SharedFlow by lazy { Api.observeData().map {result-> transformData(result) } . shareIn(scope, timeout, 1) val flow = flow fun forceFetchNewData() { _flow.resetReplayCache()// how can I...