1 2 3 4 5 6 7 8 9
use yew::{hook, use_context}; use super::manager::ToastManager; use super::utils::Notifiable; #[hook] pub fn use_toast<T: Notifiable + PartialEq + Clone>() -> ToastManager<T> { use_context::<ToastManager<T>>().unwrap_or_default() }