JS.show in handle_event instead of phx-click with JS.show

Hi!

Do you really want to wait until the server event is handled before changing the page?

If so, you have a few options:

But maybe you’d be better off doing an optimistic UI change, see José Valim explain in https://youtu.be/fCdi7SEPrTs?si=iyxZM8FdE7clKYKI.

Also at Syncing changes and optimistic UIs in the official docs.