Ask HN: Data store recommendation when using Htmx
Saw a thread discussing htmx[1], and thought it was time to give it a go.
anyone have a recommendation for a simple cookie, localstorage, session etc library that works well with it?
[1] htmx.org
grateful for any replies!
6 comments
[ 2.1 ms ] story [ 26.5 ms ] thread(on the backend im using php and arangodb.)
if you do want to do some client side stuff, Alpine.js is a popular and lightweight option
For authenticated users, just store a user pref record on your database. For state that is not linked to a user account, use the standard session mechanism of your backend. Alternatively, just use good-old functional cookies, with the Set-Cookie HTTP header. Set them to be available to javascript if needed.