package ru.forbion.f7cloud.core.push

import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.flow.asSharedFlow

/**
 * In-app bridge for FCM payloads — lets open screens refresh without waiting for user action.
 */
object F7PushEventHub {
    private val _events = MutableSharedFlow<F7PushEvent>(extraBufferCapacity = 32)
    val events: SharedFlow<F7PushEvent> = _events.asSharedFlow()

    fun publish(event: F7PushEvent) {
        _events.tryEmit(event)
    }
}
