DEV Community

Cover image for Build a desktop app with Electron and Svelte

Build a desktop app with Electron and Svelte

Khang on March 27, 2021

Hello everyone, welcome to another article in the series Let's build something!, a series dedicated to building, well, something that involves seve...
Collapse
 
triptych profile image
Andrew Wooldridge

Thanks for this!

Collapse
 
yozawiratama profile image
Yoza Wiratama

how to pass click event from svelte to electron? or call some electron function from svelte?

Collapse
 
khangnd profile image
Khang

I'm not sure if it's possible for the first one, due to the fact that Svelte and Electron are 2 separate processes, but the second one is doable. I would advise that you consult the Electron documentation for a better explanation.

Collapse
 
johngicharu profile image
John Gicharu

Hi, you could try sending messages once the click event is detected to ipcMain. You might find this useful electronjs.org/docs/api/ipc-main

Collapse
 
souksyp profile image
Souk Syp.

It works. Are there any hot reloading tricks? thanks for the tuto.

Collapse
 
khangnd profile image
Khang

Maybe try this electron-reload package, I personally haven't tried it but it looks fairly simple to use.

Collapse
 
souksyp profile image
Souk Syp.

Exactly what I need. Thanks !

Collapse
 
abdallahmoh profile image
Abdallah Mohammed

Finally got it working Github Repo

Collapse
 
solothought profile image
Solo Thought

libraries are rapidly changing. These instructions are very old. Please update them latest

Collapse
 
khangnd profile image
Khang

That'd be $99, sir. Or you can do one and keep it always up-to-date.

Collapse
 
bmehder profile image
Brad Mehder

Oh, man. The possibilities are endless. Thank you for sharing!

Collapse
 
khangnd profile image
Khang

My pleasure!