-
Notifications
You must be signed in to change notification settings - Fork 202
Closed
Description
Echo provides the functionality to listen a laravel notification events which internally calls the listen method on channel instance i.e.
notification(callback: Function): Channel {
// internally calls the listen method for the notification event
return this.listen(
'.Illuminate\\Notifications\\Events\\BroadcastNotificationCreated',
callback
);
}This way, we don't have to provide the notification event name.
But when unsubscribing from the channel, we have to pass the notification event name
const channel = new Echo(...)
channel.notification(() => {})
// when finished
channel.stopListening('.Illuminate\\Notifications\\Events\\BroadcastNotificationCreated')It would be better if we could provide a method on the channel instance that would do it.
+ stopListeningForNotification (): Channel {
+ return this.stopListening('.Illuminate\\Notifications\\Events\\BroadcastNotificationCreated')
+ }Please let me know what do you think. I would love to contribute.
devzom, dnnp2011, bricehartmann, TheseGuysCRM and ricnic
Metadata
Metadata
Assignees
Labels
No labels