pub fn use_notification<'hook, T>(
) -> impl 'hook + Hook<Output = NotificationsManager<T>>
where T: 'hook + Notifiable + PartialEq + Clone,
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 */
}