Closed lnrdnl closed 8 months ago
Hello, thank you for using the Vutron template and contributing to the work.
The sendSync
in your example isn't causing any serious performance degradation, but I agree with replacing it with invoke as it can be confusing to use in the template, and I think the functionality works well enough to replace the existing code.
There are a few things missing (translation keys), but I'll work on that further, and I'll merge this PR.
Thanks a lot!
I removed sendSync. Electron docs says you should not use it. Use invoke instead:
See https://www.electronjs.org/docs/latest/tutorial/ipc#using-ipcrenderersendsync
The structure of this code is very similar to the invoke model, but we recommend avoiding this API for performance reasons. Its synchronous nature means that it'll block the renderer process until a reply is received.
I also implemented an invoke example in which you can submit a message (request).
Also I implemented logging to console which helps debugging the communication.