Пуши
This commit is contained in:
19
client-mobile/core/utils/NavigationManager.kt
Normal file
19
client-mobile/core/utils/NavigationManager.kt
Normal file
@@ -0,0 +1,19 @@
|
||||
package core.utils
|
||||
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
import kotlinx.coroutines.flow.MutableSharedFlow
|
||||
|
||||
sealed class NavEvent {
|
||||
data class OpenChat(val chatId: String) : NavEvent()
|
||||
}
|
||||
|
||||
@Singleton
|
||||
class NavigationManager @Inject constructor() {
|
||||
private val _events = MutableSharedFlow<NavEvent>(extraBufferCapacity = 1)
|
||||
val events = _events
|
||||
|
||||
fun navigateToChat(chatId: String) {
|
||||
_events.tryEmit(NavEvent.OpenChat(chatId))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user