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

Question about renderer access. #288

Open
Bug-Reaper opened this issue Mar 30, 2025 · 0 comments
Open

Question about renderer access. #288

Bug-Reaper opened this issue Mar 30, 2025 · 0 comments

Comments

@Bug-Reaper
Copy link

The store is not a singleton, so you will need to either #15, or you have to pass the values back and forth as messages. Electron provides a handy invoke/handle API that works well for accessing these values.

I am in the process of upgrading to the latest version and a question:

  1. Is it actually possible to import electron-store from the renderer <script type="module" src="./someModule.js">? Every time I try it complains about the node-imports.

My current workaround involves one new Store() in the main thread and then another new Store() in a window preload script that is then exposed globally in the renderer. I wanted to sanity check that is the correct and safe approach?

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