Rak
12/03/2021, 11:29 AMappmattus
12/03/2021, 2:11 PMrepeatOnSubscription
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:
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) }
}
}
Rak
12/03/2021, 2:11 PM