Is there a flow or channel mechanism where it is p...
# flow
a
Is there a flow or channel mechanism where it is possible to replay for new subscribers depending if the subscriber has fully completed a block with the received value. My use case is a view model and jetpack compose view where I want to replay the effect if View is recreated(For example rotation,) View Model
Copy code
private val effectsFlow = MutableSharedFlow<E>(replay = 1, extraBufferCapacity = 8)
View
Copy code
viewModel.effectsFlow.onEach { effect ->
    println("Receiving $effect") // block starts
    someAnimation() // lasts 250ms
    navigate(anotherScreen)
    println("Processing $effect completed") // block ends
}.launchIn(scope)