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 support for processing HtmxResponse in the Model and as an Argument #128

Merged
merged 4 commits into from
Aug 28, 2024

Conversation

checketts
Copy link
Collaborator

@checketts checketts commented Aug 7, 2024

Addresses #127

This enables the following usecase:

@GetMapping("/admin")
fun getAdmin(htmxResponse: HtmxResponse.Builder): JteModel {
    htmxResponse.trigger("aTrigger")
    return templates.adminIndex("Hello")
}

The JteModel is a typed template. But the HtmxResponse can be used as an argument to inform any triggers, redirect, etc. that need to happen.

This change also supports adding HtmxReponse to the model and being processed, if that approach is needed.

@wimdeblauwe
Copy link
Owner

Can you add some documentation to the README on how to use this?

@checketts
Copy link
Collaborator Author

I've added the readme examples.

@wimdeblauwe wimdeblauwe added this to the 3.5.0 milestone Aug 28, 2024
@wimdeblauwe wimdeblauwe merged commit b117795 into main Aug 28, 2024
4 checks passed
@checketts checketts deleted the checketts/htmx-response branch August 28, 2024 20: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