Can it do something similar to hx-trigger="load"?
Yeah, Alpine components have `x-init` that works just like the load trigger. You can fire off an AJAX request inside that directive, there's an example here: https://alpine-ajax.js.org/examples/lazy-load/
Show HN: Alpine Ajax – If Htmx and Alpine.js Had a Baby
21–26 of 26 posts
Re: Show HN: Alpine Ajax – If Htmx and Alpine.js Had a Baby
#22All of these related projects remind of Dojo Didgets from the mid 2000s. Not that that's a bad thing, I found that tool kit very productive! Anyone else remember Dojo fondly? Am I way off base here?
Re: Show HN: Alpine Ajax – If Htmx and Alpine.js Had a Baby
#23Re: Show HN: Alpine Ajax – If Htmx and Alpine.js Had a Baby
#24I also love the 50s styling and theme. Awesome job!
Re: Show HN: Alpine Ajax – If Htmx and Alpine.js Had a Baby
#25A few features which look minor but the author got totally right, which IMHO would allow this solution to scale very well with more complex applications. 1) X-Alpine-Target ``` generates an ajax request with this header by default: ``` X-Alpine-Target: comments comments_count ``` This is very very cool! In most usecases, one the serverside I can return a full html document and alpine-ajax will only look for #comments…
Thank you! I really have tried to sweat those details, it's reassuring to hear that's coming through.
Re: Show HN: Alpine Ajax – If Htmx and Alpine.js Had a Baby
#26I always am unsure of whether to go with unpoly, livewire and htmx lol. Maybe this will push towards htmx