Ryan Smith
02/21/2023, 1:34 AMRyan Smith
02/21/2023, 1:34 AMApkDataRepositoryMutableStateFlowFlowApkDataRepositoryFlowgildor
02/21/2023, 4:28 AMIntelliJ is indicating that all of the suspend modifiers on myIt indeed looks as something wrong suspend function needed only if it calls another suspend function And 2 main reasons why you may need suspend function is: 1. You work with some asyncronous API (based on callbacks, observer pattern etc) and use coroutine adapater to work with it 2. Use suspend functions to run some work in a separate thread using coroutines dispatchersfunctions are redundant so I’m feeling like I did something wrong thereApkDataRepository
gildor
02/21/2023, 4:30 AMgildor
02/21/2023, 4:31 AMRyan Smith
02/21/2023, 11:38 PMMapRyan Smith
02/21/2023, 11:38 PMgildor
02/22/2023, 1:53 AMI suppose what I’m aiming for is making my data layer’s API asynchronous, even if in reality it’s just updating asuspend function by itself doesn’t make your code asyncroonous, but if you use something like a standalone coroutine (launch/async) or some flow to use it to update your Map, it will emulate case with network or databaseMap
Ryan Smith
02/22/2023, 2:01 AMcreategetFlowupdatedeletegildor
02/22/2023, 2:01 AM