-
Notifications
You must be signed in to change notification settings - Fork 426
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
Reconsider adding turbo:after-stream-render
event
#1289
Comments
Would be really helpful to have an Current use case: In the hotwire-dev-tools browser extension we log warnings if the stream targets are not found. This is done in the |
I guess that won't happen, and the following reason was proclaimed:
I'm using this custom event to handle it. Works in my app. upd
It is! Apparently the domain has changed. Just replace |
@8bit-mate thanks for resurrecting that link for us. While that original opinion is entirely valid, I think it's fair to say that there are imaginable scenarios where that a stream in particular was rendered has meaningful ramifications that wouldn't apply to other mutations (given how many examples were listed in #92 over the years). It would seem ideologically consistent to include an |
Sam (former maintainer) replied that this wasn't planned, but the linked discussion is no longer available #92, so it's not clear what the rationale was.
As a few people have mentioned in the thread, many of us have found valid use cases for being able to hook into this event. It's often possible to get by manually with a
MutationObserver
, but that can be pretty clunky and in the case I'm dealing with now, also requires avoiding infinite recursion in cases where the purpose of the observer is to "clean up" any changes (for example moving which element has a client-side-managedactive
class after receiving server-side stream broadcast of a model update)If maintainers are open to this, I'd be willing to take a stab at implementing
The text was updated successfully, but these errors were encountered: