https://kotlinlang.org logo
#compose
Title
# compose
j

jaqxues

02/24/2021, 6:15 PM
Since the
DrawerState.open()
is now
suspend
, is there a new recommended way to open it from the onclick of the menu Icon? I suppose there is a better way than
GlobalScope.launch
?
i

itnoles

02/24/2021, 6:17 PM
GlobalScope.launch should not be used.
☝️ 2
j

jaqxues

02/24/2021, 6:18 PM
I do know that, I am asking for a Coroutine Scope that should be used
2
a

Adam Powell

02/24/2021, 6:18 PM
val myScope = rememberCoroutineScope()
👍 1
j

jaqxues

02/24/2021, 6:19 PM
Alright, will use that then, thanks!
👍 2
v

Vsevolod Ganin

02/24/2021, 6:38 PM
Or you could use
LaunchedEffect
if that is suitable for you
j

jaqxues

02/24/2021, 6:38 PM
well no, the onclick lambda is not an
@Composable
v

Vsevolod Ganin

02/24/2021, 6:39 PM
Ah sorry, missed that “onclick” part