@itd-api/hydrate / HydratedNotificationEvents
Type Alias: HydratedNotificationEvents
type HydratedNotificationEvents = object & NotificationEvents;Defined in: packages/hydrate/src/types.ts:374
Поток, передающий гидратированные уведомления и контексты.
Type Declaration
on()
on<K>(event, listener): Unsubscribe;Type Parameters
K
K extends keyof NotificationEventsMap<NotificationEventContext>
Parameters
event
K
listener
Listener<HydratedNotificationEventsEvent<K>>
Returns
Unsubscribe
once()
once<K>(event, listener): Unsubscribe;Type Parameters
K
K extends keyof NotificationEventsMap<NotificationEventContext>
Parameters
event
K
listener
Listener<HydratedNotificationEventsEvent<K>>
Returns
Unsubscribe
onNotification()
Call Signature
onNotification<T>(selector, handler): Unsubscribe;Type Parameters
T
T extends NotificationType
Parameters
selector
HydratedNotificationSelector<T>
handler
HydratedEventHandler<NotificationEventContext<NotificationUpdate<T>>>
Returns
Unsubscribe
Call Signature
onNotification<C>(guard, handler): Unsubscribe;Type Parameters
C
C extends NotificationContext
Parameters
guard
(context) => context is HydratedEventContext<C>
handler
Returns
Unsubscribe
Call Signature
onNotification(predicate, handler): Unsubscribe;Parameters
predicate
(context) => boolean
handler
HydratedEventHandler<NotificationContext>
Returns
Unsubscribe
onUpdate()
Call Signature
onUpdate(handler): Unsubscribe;Parameters
handler
Returns
Unsubscribe
Call Signature
onUpdate<T>(type, handler): Unsubscribe;Type Parameters
T
T extends "unreadCount" | "notification" | "unknown"
Parameters
type
T
handler
HydratedEventHandler<NotificationEventContext<NotificationUpdateOfType<T>>>
Returns
Unsubscribe
Call Signature
onUpdate<C>(guard, handler): Unsubscribe;Type Parameters
C
C extends NotificationEventContext
Parameters
guard
(context) => context is HydratedEventContext<C>
handler
Returns
Unsubscribe
Call Signature
onUpdate(predicate, handler): Unsubscribe;Parameters
predicate
(context) => boolean
handler
Returns
Unsubscribe
use()
use(middleware): Unsubscribe;Parameters
middleware
| HydratedEventMiddleware<NotificationEventContext> | EventMiddlewareObject<HydratedEventContext<NotificationEventContext>>
Returns
Unsubscribe