4 ms·
I wrote a library based on that very idea. It supports fragment query, just like normal queries. https://github.com/Cyphrme/URLFormJS https://github.com/Cyphrm
by Zamicol 4y ago
I wrote a library based on that very idea. It supports fragment query, just like normal queries.
https://github.com/Cyphrme/URLFormJS https://github.com/Cyphrme/URLFormJS
I use it in a lot of places, like:
https://convert.zamicol.com/#?inAlph=Text&in=Hello%20world!&outAlph=01 https://convert.zamicol.com/#?inAlph=Text&in=Hello%20world!&...
https://cyphr.me/ed25519_applet/ed.html#?msg=Hello%20World!&msg_encoding=Text&msg_type=Msg&key_encoding=B64&seed=iG8QIK90uhFo_fe3-Qn8BYLYuDn7RwPgZueJJAEvvfI&key=fB0IlmPimw_dYhxuZx3Fts31-9ve_J8H1WDJSI7H1dQ https://cyphr.me/ed25519_applet/ed.html#?msg=Hello%20World!&...
https://cyphr.me/coze#?verify&input={%22pay%22:{%22root%22:%22ROUdr6Ln0KqyZWVHdouXxa6D8VGx40su2eDYZsIBbxY%22,%22text%22:%22Instructions%20were%20wrong%20but%20otherwise%20great.%20%20%22,%22rating%22:5,%22rating_denom%22:5,%22purchased%22:true,%22alg%22:%22ES256%22,%22iat%22:1645752123,%22tmb%22:%22v6Y_yH59syHMhkn0rAo4xChiLRWnSshLXgCRin6Q3c0%22,%22typ%22:%22cyphr.me/comment/create%22},%22sig%22:%22TPWzEw2O6x14bI6VKqECz9lU59WQiyfjzW0PEhH4NngRjxS1AoI3KckELnNe8809YAz8B59zkdYa_0pkzYm9tQ%22}&verify https://cyphr.me/coze#?verify&input={%22pay%22:{%22root%22:%...
- TedDoesntTalk 4y agoHow to use this in React?
- no_wizard 4y agoI don't think React has anything to do with it. Its just structuring URLs in the browser an appropriate way. You'd need to read state off the url fragment (location.hash). You can feed that into your appropriate state management system, I suppose. Some (like react router) I think support hash routing, but I don't know that they support both has routing and history routing at the same time, so that may not be quite up to task if thats the case.