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

expose reload events via API for retaining SPA state #63

Closed
Awendel opened this issue Sep 25, 2021 · 1 comment
Closed

expose reload events via API for retaining SPA state #63

Awendel opened this issue Sep 25, 2021 · 1 comment
Labels
invalid This doesn't seem right

Comments

@Awendel
Copy link

Awendel commented Sep 25, 2021

most sophisticated Electron apps are built in a SPA kind of manner, hence they expose various views just using Client logic.

Often when working on a given view & electronmon reloads the window, that view is lost & one has to manually navigate back to it.

It would be good if the module would expose an API for handling such things, in a manner like:

electronmon.on("reload", ()=>{//custom reload logic})

so one can then insert ones own navigation / routing logic to the last view one worked on.

@catdad
Copy link
Owner

catdad commented Feb 14, 2023

This seems like a bad design. That is to say, putting code in your application that relies on electronmon seems like it would lead to bugs -- that is, your dev code now relies on something that shouldn't exist in prod (I seriously home electronmon doesn't exist in prod). Not to mention, this is not really necessary. You can use any arbitrary logic to persist and reconstruct state/views on any load (whether electronmon or a user closing and reopening an app). After all, most sophisticated apps resume right where you left off on restart 😉.

I don't want to encourage users to create a bad design, especially when there is such an easy and far better alternative.

@catdad catdad added the invalid This doesn't seem right label Feb 14, 2023
@catdad catdad closed this as completed Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants