Skip to content
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

Make the app fully contained, where reloading to reset state isn't necessary #43

Open
V-ed opened this issue Nov 5, 2019 · 1 comment
Assignees

Comments

@V-ed
Copy link
Member

V-ed commented Nov 5, 2019

This basically means that the button in the results page to return to the homepage would not reload the page, but rather reset the states of every variable, remove all dynamically added elements, and dump the created data by itself, rather than using the reload page method.

This would allow the app to be fully modular, not requiring any internet connection for ALL interactions if using it through the web-hosted way. The locally downloaded website would still work even if offline, because it would reload the file, and not use any internet.

EDIT : "remove all dynamically added elements" instead of a method for it, this could be done by the setup methods of each "view" - they should therefore know what is dynamically added, as they are the one adding it afterall.

@V-ed V-ed self-assigned this Nov 5, 2019
V-ed added a commit that referenced this issue Nov 5, 2019
Some more text was also added, such as the referal to #43, spacing normalization, etc.
@V-ed
Copy link
Member Author

V-ed commented Nov 14, 2019

A problem with this will be how to handle all of the events attached to all sorts of inputs in the different views of this program.

My idea to go over this would be to create an utility method / class that stores all the details of the inputs, event types, and function, which would allow a generic utility method to iteratively remove all events added.

Therefore, every addEventListener that I use in this project will be be changed to support that new method / class, unifying everything nicely.

Quick removeEventListener doc link : https://www.w3schools.com/jsref/met_element_removeeventlistener.asp

Quick link to static method to classes : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant