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:
parent
46ccd1a003
commit
9bf83e87a2
10 changed files with 200 additions and 72 deletions
|
@ -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()
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue