Rak
12/12/2021, 6:46 PMdelay but I dont know how to do this as i get the error about not being in a suspend function when inside an `intent`block.Mikolaj Leszczynski
12/13/2021, 7:42 AMRak
12/13/2021, 8:56 AMfun qrCodeFound(code: String) = intent {
postSideEffect(ScanPassSideEffect.ShowSpinner)
reduce {
delay(1000)
val passResult = decodeQrCode(code)
The delay won’t work as its not in a suspend function which is strange because I thought all reduce calls weer within a viewmodelscope on android?Mikolaj Leszczynski
12/13/2021, 8:57 AMreduce is not a suspending block and for good reason. You should never do delay inside reduce as it locks up orbit’s event loop.Mikolaj Leszczynski
12/13/2021, 8:58 AMreduceRak
12/13/2021, 8:58 AMappmattus
12/15/2021, 10:50 AMdecodeQrCode is expensive then that should also be moved outside of the reduce block too