1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 05:47:05 +09:00

DROID-2550 App | Tech | Process event channel refactoring (#1357)

This commit is contained in:
Konstantin Ivanov 2024-07-04 14:54:47 +02:00 committed by GitHub
parent 46ccd1a003
commit 9bf83e87a2
Signed by: github
GPG key ID: B5690EEEBB952194
10 changed files with 200 additions and 72 deletions

View file

@ -1,18 +1,32 @@
package com.anytypeio.anytype.data.auth.event
import com.anytypeio.anytype.core_models.Process
import com.anytypeio.anytype.domain.workspace.EventProcessChannel
import com.anytypeio.anytype.domain.workspace.EventProcessDropFilesChannel
import com.anytypeio.anytype.domain.workspace.EventProcessImportChannel
import kotlinx.coroutines.flow.Flow
interface EventProcessRemoteChannel {
fun observe(): Flow<List<Process.Event>>
interface EventProcessImportRemoteChannel {
fun observe(): Flow<List<Process.Event.Import>>
}
class EventProcessDateChannel(
private val channel: EventProcessRemoteChannel
) : EventProcessChannel {
class EventProcessImportDateChannel(
private val channel: EventProcessImportRemoteChannel
) : EventProcessImportChannel {
override fun observe(): Flow<List<Process.Event>> {
override fun observe(): Flow<List<Process.Event.Import>> {
return channel.observe()
}
}
interface EventProcessDropFilesRemoteChannel {
fun observe(): Flow<List<Process.Event.DropFiles>>
}
class EventProcessDropFilesDateChannel(
private val channel: EventProcessDropFilesRemoteChannel
) : EventProcessDropFilesChannel {
override fun observe(): Flow<List<Process.Event.DropFiles>> {
return channel.observe()
}
}