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

Skip to content

feat(vue): allow checking if echo is configured #448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

hendrikheil
Copy link
Contributor

This PR adds a simple additional helper function to the Vue integration of Laravel Echo. This is a useful addition for cases where you might want echo to be an optional addition to an app. This allows you to check if the application configured echo, so you can listen to events elsewhere in the application, without having to handle the exception that useEcho or echo will throw when unconfigured.

Example:

if (import.meta.client && isEchoConfigured()) {
  useEcho(...)
}

Prior to this change you have to either handle the configuration state check yourself or catch the error.

@hendrikheil hendrikheil force-pushed the feat/allow-checking-echo-configured branch 2 times, most recently from 6ad0c02 to 1d0224e Compare July 18, 2025 11:23
@hendrikheil hendrikheil force-pushed the feat/allow-checking-echo-configured branch from 1d0224e to 851f239 Compare July 18, 2025 11:34
@taylorotwell taylorotwell marked this pull request as draft July 18, 2025 15:54
Copy link
Contributor

@joetannenbaum joetannenbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjusted the name of the function and added it to the React package as well 👍

@joetannenbaum joetannenbaum marked this pull request as ready for review July 18, 2025 17:41
@joetannenbaum joetannenbaum merged commit fa7a873 into laravel:2.x Jul 18, 2025
3 checks passed
@hendrikheil hendrikheil deleted the feat/allow-checking-echo-configured branch July 18, 2025 19:29
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.

2 participants