-
Notifications
You must be signed in to change notification settings - Fork 441
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
Adds append_unless_duplicate and prepend_unless_duplicate #478
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When appending or prepending content we want to control what the action should do if there are already matching elements on the page. This is especially true when responding and broadcasting streams contain the same data. Additional actions added to skip the action if elements are already present. In this case it would be recommended to use the `replace` action.
seanpdoyle
added a commit
to seanpdoyle/turbo
that referenced
this pull request
Nov 26, 2021
Closes hotwired#478 Closes hotwired#477 As an alternative to continuing to introduce support for more varied and specialized `<turbo-stream action="...">` values, this commit exports the `StreamActions` module from the root-module in order to provide applications with direct access. Applications can add new actions or override existing actions, so long as they adhere to the `StreamAction` interface: a function whose `this` context is an instance of `StreamElement`.
seanpdoyle
added a commit
to seanpdoyle/turbo
that referenced
this pull request
Nov 26, 2021
Closes hotwired#478 Closes hotwired#477 As an alternative to continuing to introduce support for more varied and specialized `<turbo-stream action="...">` values, this commit exports the `StreamActions` module from the root-module in order to provide applications with direct access. Applications can add new actions or override existing actions, so long as they adhere to the `StreamAction` interface: a function whose `this` context is an instance of `StreamElement`.
As an alternative to broadening official support for more |
Closed in favour of #479 |
seanpdoyle
added a commit
to seanpdoyle/turbo
that referenced
this pull request
Jul 18, 2022
Closes hotwired#478 Closes hotwired#477 As an alternative to continuing to introduce support for more varied and specialized `<turbo-stream action="...">` values, this commit exports the `StreamActions` module from the root-module in order to provide applications with direct access. Applications can add new actions or override existing actions, so long as they adhere to the `StreamAction` interface: a function whose `this` context is an instance of `StreamElement`.
seanpdoyle
added a commit
to seanpdoyle/turbo
that referenced
this pull request
Jul 18, 2022
Closes hotwired#478 Closes hotwired#477 As an alternative to continuing to introduce support for more varied and specialized `<turbo-stream action="...">` values, this commit exports the `StreamActions` module from the root-module in order to provide applications with direct access. Applications can add new actions or override existing actions, so long as they adhere to the `StreamAction` interface: a function whose `this` context is an instance of `StreamElement`.
seanpdoyle
added a commit
to seanpdoyle/turbo
that referenced
this pull request
Jul 18, 2022
Closes hotwired#478 Closes hotwired#477 As an alternative to continuing to introduce support for more varied and specialized `<turbo-stream action="...">` values, this commit exports the `StreamActions` module from the root-module in order to provide applications with direct access. Applications can add new actions or override existing actions, so long as they adhere to the `StreamAction` interface: a function whose `this` context is an instance of `StreamElement`.
seanpdoyle
added a commit
to seanpdoyle/turbo
that referenced
this pull request
Jul 18, 2022
Closes hotwired#478 Closes hotwired#477 As an alternative to continuing to introduce support for more varied and specialized `<turbo-stream action="...">` values, this commit exports the `StreamActions` module from the root-module in order to provide applications with direct access. Applications can add new actions or override existing actions, so long as they adhere to the `StreamAction` interface: a function whose `this` context is an instance of `StreamElement`.
dhh
pushed a commit
that referenced
this pull request
Jul 18, 2022
Closes #478 Closes #477 As an alternative to continuing to introduce support for more varied and specialized `<turbo-stream action="...">` values, this commit exports the `StreamActions` module from the root-module in order to provide applications with direct access. Applications can add new actions or override existing actions, so long as they adhere to the `StreamAction` interface: a function whose `this` context is an instance of `StreamElement`.
Challenge-Guy
pushed a commit
to Challenge-Guy/turbo-cfm1
that referenced
this pull request
Mar 8, 2025
Closes hotwired/turbo#478 Closes hotwired/turbo#477 As an alternative to continuing to introduce support for more varied and specialized `<turbo-stream action="...">` values, this commit exports the `StreamActions` module from the root-module in order to provide applications with direct access. Applications can add new actions or override existing actions, so long as they adhere to the `StreamAction` interface: a function whose `this` context is an instance of `StreamElement`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When appending or prepending content we want to control what
the action should do if there are already matching elements
on the page.
This is especially true when responding and broadcasting streams
contain the same data.
Additional actions added to skip the action if elements are
already present. In this case it would be recommended to use
the
replace
action.