euv-ui 0.24.0

Reusable UI component library for the euv framework, providing buttons, cards, modals, inputs, and more.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::*;

/// OPT-23: returns a clone of the shared `Rc<RefCell<Vec<ConsoleEntry>>>`
/// that backs the vConsole log signal, or `None` if `Console::init` has
/// not yet installed it.
pub(crate) fn console_log_ref() -> Option<Rc<RefCell<Vec<ConsoleEntry>>>> {
    CONSOLE_LOG_REF.with(|cell| cell.borrow().clone())
}

/// OPT-23: installs the shared `Rc<RefCell<Vec<ConsoleEntry>>>` backing
/// store for the vConsole log signal. Called from `Console::init`.
pub(crate) fn install_console_log_ref(logs_ref: Rc<RefCell<Vec<ConsoleEntry>>>) {
    CONSOLE_LOG_REF.with(|cell| {
        *cell.borrow_mut() = Some(logs_ref);
    });
}