mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-24 18:36:21 +03:00
Add function to provide a Flow of a single UserAccountDataEvent
This commit is contained in:
parent
461beda634
commit
fa92aff11c
1 changed files with 7 additions and 0 deletions
|
@ -152,6 +152,13 @@ class FlowSession(private val session: Session) {
|
|||
}
|
||||
}
|
||||
|
||||
fun liveUserAccountData(type: String): Flow<Optional<UserAccountDataEvent>> {
|
||||
return session.accountDataService().getLiveUserAccountDataEvent(type).asFlow()
|
||||
.startWith(session.coroutineDispatchers.io) {
|
||||
session.accountDataService().getUserAccountDataEvent(type).toOptional()
|
||||
}
|
||||
}
|
||||
|
||||
fun liveRoomAccountData(types: Set<String>): Flow<List<RoomAccountDataEvent>> {
|
||||
return session.accountDataService().getLiveRoomAccountDataEvents(types).asFlow()
|
||||
.startWith(session.coroutineDispatchers.io) {
|
||||
|
|
Loading…
Reference in a new issue