Код: Выделить всё
val dataStore = StoreAppSettings(ctx)
val scope = rememberCoroutineScope()
scope.launch {
dataStore.getCycleStart.collectLatest { vm.cycleStart = it }
dataStore.getSmartCycle.collectLatest { vm.smartCycle = it }
scope.cancel()
}
if (vm.categories.isNotEmpty() && !scope.isActive) {
LaunchedEffect(key1 = ctx){
vm.updateTransactionState()
}
}
Подробнее здесь: https://stackoverflow.com/questions/784 ... -coroutine
Мобильная версия