I'm trying to use AlpineJS to update the displayed data from localStorage every time I click a button.
I have two buttons that use setItem to update the value in localStorage.
This all works, but I can't figure out how to use AlpineJS to update the displayed data (using getItem) when the button is clicked.
When the button is clicked, the value in localStorage does change, but I have to reload the page to update the data on FE.
Could someone give me some advice on how to solve this using AlpineJS?
CodePen
I'm new to AlpineJS and I've tried the documentation, but I really don't know how to grasp it.
Thank you in advance for any tips