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

SSE trigger variety #66

Closed
tomberek opened this issue May 29, 2020 · 3 comments
Closed

SSE trigger variety #66

tomberek opened this issue May 29, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@tomberek
Copy link

Currently an SSE event can only trigger a new GET request. This works when the SSE is use to notify the frontend of available data, but often the SSE event itself can contain what is needed. Other targets, swapping, and indicator behaviors with SSE would be wonderful. For example:

<div hx-trigger="sse:thing" hx-swap="innerHTML">Waiting for callback</div>
@tomberek
Copy link
Author

or

<ol hx-trigger="sse:streamingListOfStuff" hx-swap="beforeend">Loading list...</ol>

@1cg
Copy link
Contributor

1cg commented May 30, 2020

hey tom,

Yes, that's how the websockets work, so SSE should support that mode as well.

Maybe something like:

<ol hx-sse="swap on eventName" hx-swap="beforeend">Loading list...</ol>

@tomberek
Copy link
Author

Implemented

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

2 participants