2 ms·
As somebody else suggested just a share link would be a good way to allow sharing. Alternatively, for either a share link or as just a way to keep the state in
by methodical 3y ago
As somebody else suggested just a share link would be a good way to allow sharing. Alternatively, for either a share link or as just a way to keep the state in the URL, I'd recommend B64 encoding the data as opposed to just directly escaping it. URLs have a maximum length (forgot off the top of my head, may be 1024 or something), so storing large stringified objects usually results in issues as opposed to just encoding it. It also makes for a more logical URL structure of fundingsimulator.com/{b64}. This is if you wanted to keep the URL as the single source of truth on the state, otherwise you could keep state internally which can be initialized by optional URL state (structured as stated before), and then just encode it and put it in a URL which is copied to clipboard when a share button is clicked.