top | item 28621583

(no title)

akoutmos | 4 years ago

For a lot of the LiveView applications that I write (which is actually quite a few these days), I will usually lean on something like AlpineJS for frontend specific interactions, and my LiveView state is for things that require backend state.

For example, if I have a flag to show/hide a modal to confirm a resource delete, the show/hide flag would live in AlpineJS, while the resource I was deleting would live in the state of my LiveView.

This way, there are no round trips to the server over websocket to toggle the modal. Hopefully that example makes sense :).

discuss

order

cs44|4 years ago

I'm surprised to see so few mentions of AlpineJS. Personally, PETAL has become my de facto stack.

AlchemistCamp|4 years ago

The main thing that's kept me from using Alpine in my serious projects is that it doesn't work with a strict CSP.

brainbag|4 years ago

What is PETAL?