dan.the.man
05/13/2021, 5:36 PMfun <T> LifecycleOwner.stateFlow(stateFlow: StateFlow<T>, funCollect: (T) -> Unit) {
lifecycleScope.launchWhenStarted {
stateFlow.collect() {
funCollect(it)
}
}
}
Is how I subscribe to a Stateflow. I then subscribe to that in my fragment. However, very infrequently, my Stateflow doesn't emit.
Timber.d(//This log is hit)
model.data.emit(result)
The log above is hit, in theory I would think it should have emit, but for some reason, my subscription is never hit in my fragment. The correct object is being pushed to/observed, not sure what's happening, any thoughts?ursus
05/13/2021, 6:36 PMdan.the.man
05/13/2021, 6:37 PMursus
05/13/2021, 7:16 PMdan.the.man
05/13/2021, 7:16 PMursus
05/13/2021, 7:29 PMdan.the.man
05/13/2021, 7:30 PMursus
05/13/2021, 7:32 PMdan.the.man
05/13/2021, 9:31 PMursus
05/13/2021, 10:02 PMdan.the.man
05/13/2021, 10:20 PMRyan Rolnicki
05/13/2021, 11:28 PMdan.the.man
05/14/2021, 12:19 AM