Alpine.js and Phoenix LiveView hooks: both needed?

I know it has been a while since this discussion, but I think the Phoenix.LiveView.JS API provides a good way to push events from JS.

<button 
  class="btn" 
  @click.prevent="liveSocket.execJS($el, $el.dataset.decrement)" 
  data-decrement={JS.push("decrement", target: @myself)}>-</button>
2 Likes