Dsittel
05/27/2020, 6:05 AMflow.count() == 0 ?
gildor
05/27/2020, 7:41 AMDsittel
05/27/2020, 8:39 AMgildor
05/27/2020, 9:22 AMbut if there are no elementsBut Flow<T> from database is not a container for list of elements, it probably a stream of updates of database
Dsittel
05/27/2020, 9:25 AMgildor
05/27/2020, 9:28 AMDsittel
05/27/2020, 9:29 AMgildor
05/27/2020, 9:29 AMDsittel
05/27/2020, 9:32 AMgildor
05/27/2020, 9:32 AMDsittel
05/27/2020, 9:33 AM@GetMapping("/")
fun findAll(): Flow<User> =
userRepository.findAll()
gildor
05/27/2020, 9:36 AMfindAll().toList()
Dsittel
05/27/2020, 9:59 AMgildor
05/27/2020, 10:00 AMDsittel
05/27/2020, 10:02 AMgildor
05/27/2020, 10:06 AMfun getData(): Flow<T> {
require(flow.count() > 0) { “DB is empty }
// at this monent DB is changed, items deleted
return flow // you still have to request flow again
}
```
Dsittel
05/27/2020, 10:08 AMchristophsturm
05/27/2020, 10:09 AMgildor
05/27/2020, 10:09 AMchristophsturm
05/27/2020, 10:12 AMgildor
05/27/2020, 10:15 AMLuis Munoz
05/27/2020, 9:40 PMgildor
05/28/2020, 12:39 AMDsittel
05/28/2020, 5:39 AMchristophsturm
05/28/2020, 8:23 AMgildor
05/28/2020, 9:44 AMchristophsturm
05/28/2020, 9:51 AMgildor
05/28/2020, 9:59 AMcount
property in your json