Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

joetannenbaum
Copy link
Contributor

This PR addresses some of the valid clunkiness in listening for broadcast notifications noted in #440 with a new useEchoNotification hook for both React and Vue:

import { useEchoNotification } from '@laravel/echo-react';

// Listen to all events
useEchoNotification('App.Models.User.1', (event) => {});

// Listen to specific events
useEchoNotification('App.Models.User.1', (event) => {}, [
    'App.Notifications.InvoicePaid', 
    'App.Notifications.OrderShipped',
]);

@joetannenbaum joetannenbaum merged commit fbd7d26 into 2.x Jun 3, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant