Function yew_notifications::use_notification
source · pub fn use_notification<'hook, T>(
) -> impl 'hook + Hook<Output = NotificationsManager<T>>
Expand description
This hook is used to manage notifications.
Returned NotificationsManager
can be used to spawn new notifications of the type T
.
Example
use yew_notifications::{Notification, use_notification};
let notifications_manager = use_notification::<Notification>();
notifications_manager.spawn(Notification::new(/* */));
Note
When used in function components and hooks, this hook is equivalent to:
pub fn use_notification<T: Notifiable + PartialEq + Clone>() -> NotificationsManager<T> {
/* implementation omitted */
}