Skip to content
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

Add a Listener to refresh component with pusher events (websockets) #12

Open
xtreme2020 opened this issue Nov 11, 2022 · 8 comments
Open
Labels
enhancement New feature or request

Comments

@xtreme2020
Copy link

It would be great if we can call a listener or method using pusher events to show real-time notifications without reloading the page

@mikebarlow
Copy link
Owner

Hey, this is definitely on my radar for something to add.

I considered it a "nice to have" rather than "need" for the first release. Fear not, it will be coming soon though.

@mikebarlow mikebarlow added the enhancement New feature or request label Nov 13, 2022
@xtreme2020
Copy link
Author

Great, waiting for it, also i would like to thanks for this component is really useful.

@MCKLtech
Copy link

MCKLtech commented Mar 24, 2023

Would <div wire:poll> be a quick win here, perhaps?

@mikebarlow
Copy link
Owner

Yeah, so a wire:poll would be a quick win but not keen on doing that for this package.
I will have some time coming up in the next few weeks so plan to look at this then as I would like this feature included for a project I "dog food" Megaphone with.

@titonova
Copy link

titonova commented Jul 4, 2023

Yeah, so a wire:poll would be a quick win but not keen on doing that for this package. I will have some time coming up in the next few weeks so plan to look at this then as I would like this feature included for a project I "dog food" Megaphone with.

Hi Mike,

While I completely understand your perspective on this matter, I believe it is an essential feature that many users would greatly benefit from. Without this feature, users would need to modify the source code itself, which could be inconvenient and time-consuming.

I would like to propose a solution that involves adding just two lines of code to implement the wire:poll feature. This addition would provide users with the functionality they need while still allowing for easy removal once a better alternative becomes available. I believe this approach strikes a balance between addressing the user demand for the feature and ensuring flexibility in the long term.

If you are open to this suggestion, I would be more than happy to create a pull request to incorporate the wire:poll feature into the package. I value your input and look forward to hearing your thoughts on this matter.

Thank you for your time and consideration.

Best regards,
Tito

@mikebarlow
Copy link
Owner

Hey, apologies have been wanting to look at this, but having a 1-year-old child is time-consuming!

Thinking about it, I'd definitely consider a PR for this if we can make the wire:poll conditional with a new boolean config setting. If we have an "enableWirePoll" config option that defaults to false, that would keep it turned off as default and anyone who updates the package won't be affected while still allowing people to turn it on if they wish.

That feels like a good compromise for now to me. And it should still be pretty easy to remove when I have a chance to look at a better alternative.

@titonova
Copy link

titonova commented Jul 4, 2023

@mikebarlow Rather than a enableWirePoll option, why not a pollInterval option, which defaults to null, so that they can choose the wire:poll interval.

@mikebarlow
Copy link
Owner

Yeah, that would also work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants