I'm creating a Store in Svelte that subscribes to value changes and stores the value on localStorage.
When opening the page there is an input tag with the value binded to the store. Everything works as intended and after refreshing the last value is there.
My problem and what I don't know how to achieve (If it's even possible) Having a 2nd tab of the same page open, as I type in one I want to see the value update on the other tab.
(I understand that the problem is that this 2nd tab is not aware of localStorage changing)
My hack solution was an interval reading an updating the value from localStorage, but that's clearly a hack and not a solution.
How would we go around something like this?
Here is a gist with the 2 files used. https://gist.github.com/MrAmericanMike/b2ddea28e4a4716e43abe03c6211c8b7