https://kotlinlang.org logo
Title
a

Arjan van Wieringen

07/03/2022, 2:38 PM
I am writing some extension functions to work with
Flow
and platform-specific API's, e.g. the web broadcastchannel API. However I choose to pass
CoroutineScope
when needed, but this leads to code like this:
states.broadcast(channel.deserialize(scope), scope)
Is it a code smell to have these kind of scopes everywhere? Or is it not a problem. My intuition says that it is not a problem, because this way I can easily control the scopes and no magic happens. So I can keep the structured concurrency.