2 ms·
> I feel like there must be a more elegant way with less repetition That doesn't actually seem that bad, if you consider that half of that repetition is so tha
by baddox 13y ago
> I feel like there must be a more elegant way with less repetition
That doesn't actually seem that bad, if you consider that half of that repetition is so that you have distributable URLs that can be opened up on another browser thousands of miles away with no other state information.
You could just have an anchor tag with no src attribute, but with onclick=setState(...). That removes the repetition, but you don't get a shareable URL.