Skip to content

Question about renderer access. #288

@Bug-Reaper

Description

@Bug-Reaper

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions