Unsubscribe a callback function from receiving notifications on a specific channel.
- API LEVEL
7
- Functionality added
The identifier of the channel from which to unsubscribe.
The callback function to be unsubscribed.
Subscribe to notifications on a specified channel, providing a callback function to handle received messages.
The identifier of the channel for which you want to receive notifications.
The callback function that will be invoked when messages are received on the specified channel.
(Optional) Indicates whether the listener should persist between navigations. Default is false. If set to true, the listener will continue to receive notifications even when the eitri-app navigates between screens. If set to false, the listener will be removed during navigation transitions.
// Subscribe to a channel and specify a callback function
Eitri.eventBus.subscribe('myChannel', (data) => {
// Handle the received data here
console.log('Received data:', data);
});
- API LEVEL
7
- Functionality added
Generated using TypeDoc
Tools for listening to events on your eitri-app coming from the main app.
You can also use this bus to implement a pub/sub pattern inside your eitri-app.