Hi, I have a main screen that shows your status. Y...
# orbit-mvi
r
Hi, I have a main screen that shows your status. You go off to other screens that update your status and then you return to the main screen. Problem is that I am not sure how to best refresh the status? No intents are firing on return (I think the last State is displayed but its no longer valid).
a
indeed, nothing will re-trigger on return you can possibly use
repeatOnSubscription
inside the
onCreate
block which is cancelled when there are no subscribers to either
state
or
sideEffect
flows and re-executed when there is at least one subscriber to either, if that makes sense. something like:
Copy code
val container = container<…>(initialState {
    repeatOnSubscription {
        // this will (re-)execute every time there is at least one active subscriber
        val result = lookupValue()
        reduce { copy(result = result) }
    }
}
today i learned 1
r
I’ll try that, thanks!