IReactNotificationService
Kind: interface
The notification service that can be used to send notifications between different components in an app.
Use the Subscribe method to subscribe to notifications and the SendNotification method to send notifications.
Methods
SendNotification
void SendNotification(IReactPropertyName notificationName, Object sender, Object data)
Sends the notification with notificationName.
notificationNameis the name of the notification to send. It must not be null.senderis the object that sends notification. It can be null.datais the data associated with the notification. It can be null. Consider usingIReactPropertyBagfor sending semi-structured data. It can be created using theReactPropertyBagHelper.CreatePropertyBagmethod.
Subscribe
IReactNotificationSubscription Subscribe(IReactPropertyName notificationName, IReactDispatcher dispatcher, ReactNotificationHandler handler)
Subscribes to a notification.
notificationNameis a non-null notification name that can belong to a specific namespace like anyIReactPropertyName.dispatcheris used to call notification handlers. If it is null, then the handler is called synchronously.handleris a delegate that can be implemented as a lambda to handle notifications. The method returns aIReactNotificationSubscriptionthat must be kept alive while the subscription is active. The subscription is removed when theIReactNotificationSubscriptionis destroyed.