https://kotlinlang.org logo
Title
s

stojan

08/24/2021, 1:20 PM
Can we do something like this, but with
CoroutineScope
instead of a
Job
? I need to launch a few suspend functions, and cancel them if a) the parent scope is canceled b) the VH scope is canceled (whatever comes first)
l

louiscad

08/24/2021, 1:21 PM
Yes, that one works well.
j

Johnjake Talledo

08/24/2021, 1:31 PM
@stojan just curious why would you want to use suspend in
ViewHolder
?
oh I see you want to launch suspend function on
VH
l

louiscad

08/24/2021, 1:34 PM
Being able to cancel a coroutine on unbind is pretty good for a bunch of use cases.
2
a

Adam Powell

08/24/2021, 1:34 PM
It lets you maintain ongoing reactive updates to RecyclerView items in a nice way
1