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

Better management for events #44

Open
5 of 6 tasks
desko27 opened this issue Apr 14, 2022 · 0 comments
Open
5 of 6 tasks

Better management for events #44

desko27 opened this issue Apr 14, 2022 · 0 comments

Comments

@desko27
Copy link
Owner

desko27 commented Apr 14, 2022

We need a clearer contract for the events, especially when dealing with them in the renderer process.

  • Create enums for each event
  • Maybe use this
  • Consider building a class for events management, so an instance is "exposed to the main world" and can be used like an API client for events (a bag of known methods)
  • Improve preload.js (and add types, although if the previous one is done it will be typed already because of the class)
  • Move from window.electron to window.whatever, since the name electron is confusing because it's not actually electron but a custom API that is exposed in window from preload.js
  • Add specific types in electron.d.ts for window.whatever (rename to whatever.d.ts too), importing specific event types (from original events file, or from @types) so event listeners provide intellisense in the renderer code (again, if a class instance is registered in preload.js we will only need to load that one to get the right typings)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant