Post

We want people to be able to share the settings for our games and tools, or save their own settings. To account for all the options, we have two ways of initializing state using Sveltekit features: shared URL and Local Storage stores. If people have a better way to do this, let me know!

When we mount the page, we check if we received data from load. If we didn't, then we check Local Storage (again verifying data), if nothing is there, we initialize it and put in a default. We use a store for each page's menus, and so far we aren't near the limit of local storage, but we'll see.

This is my cobbled together solution to let users share stuff, while maintaining their local device settings. It feels a bit janky, so would love suggestions to improve it or more efficient ways to implement.

0 reposts0 likes

No replies yet.