-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add deeplinks? #49
Comments
I'm not fully sure how it could be made generic. As you said, one approach would be to just store all of the relevant variables as URL parameters, but I'm not quite sure how to allow the programmer to set those and load them generically other than setting up some list of pointers. Alternatively, there could be "menus" or "scenes" in the widget library. Then each scene just needs a unique name and some mechanism for skipping to specific scenes. Maybe using some sort of event-based model? The init phase registers the objects in a scene, then events are called when things happen. That way the "root" can have a function called after the initial setup to move into the desired scene. |
Or a "state snapshot". I wouldn't stress over this. If we keep it in the back of our head, maybe something will come to light as we work though the API. Many (most) things take iteration and evolution to get good. |
I've been thinking of some possible implementations for this. I think the easiest might be something like a model, view, controller paradigm. Where the persistent state is stored in the model, the controller would be things like events, and the view would handle the rendering. The main problems would be serialization, deserialization, and dealing with mixed persistent/non-persistent state. Serialization/Deserialization: Mixed persistent/non-persistent state: |
I was thinking of posting a link to Pong to the discord wasm demos section. But i was thinking I would like to paste a link to the Pong 2 Player AI version (and skip the intro menu, when this demo link is used). For example, i sorted of wanted to select the 2 Player AI mode, than copy the link in the address bar (but of course the link didn't change when i selected the 2P AI menu). How would we do that in a general way? Is it just an app feature (you could easily add the code to your index.html to look at the #Pong2AI (like we do for #async sometimes). But is there a more generic feature?
It seems like it might be a feature of your button widget library.
Or, more generically, a feature of a UI library. For example, one might have "screens" that can be deep linked to. Or one might have various UI status adjust the URL in the title bar so that they contain all the state info in the link so that a copy/paste of the link can deep link to that state.
The text was updated successfully, but these errors were encountered: