use lazy_static::lazy_static;
use tokio::sync::broadcast;

#[allow(dead_code)]
#[derive(Debug, Clone)]
pub enum UiCmd {
    Repaint,
}

lazy_static! {
#[allow(dead_code)]
    static ref UiBroadcast: broadcast::Sender<UiCmd> = {
        let (tx, _) = broadcast::channel(10);
        tx
    };
}

#[allow(dead_code)]
pub fn get_ui_broadcast_sender() -> broadcast::Sender<UiCmd> {
    UiBroadcast.clone()
}

#[allow(dead_code)]
pub fn get_ui_broadcast_receiver() -> broadcast::Receiver<UiCmd> {
    UiBroadcast.subscribe()
}
