I’m struggling to understand what you are trying t...
# coroutines
e
I’m struggling to understand what you are trying to achieve, because there is no larger context in this snippet code. Can you post a larger piece of code to github? It all looks way too complex. It should not be that way. Why
productDataStore.loadProducts
returns a channel, even though it seem that this channel has only only value and this value is a list? Why it takes both job and coroutineContext params? Why it is not simply a suspending function returning a list? Why you use
actor.offer
yet create an actor with a default rendezvous channel? Is it an intended behavior that the next action is going to be dropped while actor had not finished the previous one? Why do you need
lateinit var channel
? Why separate
viewState
property and a separate
viewState()
function? There is too much code to do something simple, or so it seems.