-
Hi, I'm struggling to solve a vuex communication between main + renderer. The use case seems pretty simple:
For example click on "about" - open modal (triggered by vuex) in renderer process. I'm looking for a way to keep the renderer clean from any electron communication libraries like First approach is to use some sort of environment library to keep renderer clean from any Something like this:
With the above approach I Ignored the main/src/index.ts
preload/src/index.ts
context
Does anyone have examples or did something similar to get an idea for the communication? Regards |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
First of all: Do you really need a Vuex for this? Very often Vuex is used where it is excessive. Think about it again. In one of my projects I use the following approach: |
Beta Was this translation helpful? Give feedback.
-
Hi. No i just mentioned vuex because its well known. Whats your recommendation of state management in vue3? Im currently transitioning from vue2 to vue3. so looking for some best practices. im aware of vueuse and https://pinia.vuejs.org/core-concepts/state.html. |
Beta Was this translation helpful? Give feedback.
First of all: Do you really need a Vuex for this? Very often Vuex is used where it is excessive. Think about it again.
In one of my projects I use the following approach:
Preload receives an event from the main and simply creates a new DOM event to which the renderer is listen.