IReactNotificationSubscription
Kind: interface
A subscription to a IReactNotificationService notification.
The subscription is removed when this object is deleted or the Unsubscribe method is called.
Properties
Dispatcher
readonly IReactDispatcher Dispatcher
The IReactDispatcher that was provided when the notification subscription was created.
All notifications for this subscription will be handled using this dispatcher.
If the dispatcher is null, then the events are handled synchronously.
IsSubscribed
readonly bool IsSubscribed
True if the subscription is still active. This property is checked internally before the notification handler is invoked.
NotificationName
readonly IReactPropertyName NotificationName
Name of the notification.
NotificationService
readonly IReactNotificationService NotificationService
The notification service for the subscription.
It can be null if IsSubscribed is true and the notification service was already deleted.
Methods
Unsubscribe
void Unsubscribe()
Removes the subscription.
Because of the multi-threaded nature of the notifications, the handler can be still called after the Unsubscribe method has been called if the IsSubscribed property has already been checked. Consider calling the Unsubscribe method and the handler in the same IReactDispatcher to ensure that no handler is invoked after the Unsubscribe method call.