|
|
|
|
|
by franky47
1005 days ago
|
|
The scroll feature to rewind/forward moves on a game, with syncing the state in the URL, is just awesome. Do you mind sharing how it's done? I just published a library [1] that deals with syncing complex state in the URL, and I'd love to hear more about actual use-cases in the wild. [1] https://github.com/47ng/next-usequerystate |
|
My code for that is rather simple. I'm using Next.js and the code looks something like this (a little simplified):
In addition, I have some caching in place so that each position is only downloaded once and the change function looks a little more complicated in my case as there are multiple values that can be change for each page.